Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Integrating Passive Federation

Integrating Passive Federation

Passive federation relies on the device's web browser to do most of the communication between the device and AD FS. That said, you still need to know what URL to request and how to acquire the SAML token from the Security Token Service's (STS) reply. The security benefit of passive federation is that the user never provides their AD credentials to your app.

The detailed passive federation workflow is presented in Introduction to Active Directory Federation Services Integration.

Prerequisites

You need to make certain settings before you can successfully log in your app users through AD FS.

Preparing the Request URL

To request a SAML token from the AD FS STS you need to open the device's web browser and point it to the appropriate URL.

The URL must be in the following format:

https:// + AD FS FQDN + /adfs/ls/ + ?wa=wsignin1.0&wreply= + MetadataUrl + /adfs/token + &wtrealm + Realm

Where:

  • AD FS FQDN is the fully qualified domain name of your AD FS.
  • MetadataUrl and Realm are contained in the AdfsMetadata class returned by getAdfsMetadata.

For example:

https://adfs.example.com/adfs/ls?wa=wsignin1.0&wreply=https://api.everlive.com/v1/your-app-id/adfs/token&wtrealm=https://api.everlive.com/v1/your-app-id

Extracting the SAML Access Token

After the browser contacts the AD FS STS and performs authentication, the STS redirects the browser to the Reply URL and posts the SAML token to it. The server logic behind the Reply URL encodes the SAML response in base64 format and redirects the user device browser to localhost appended with the access_token HTML parameter containing the SAML token. You need to parse the resulting URL to extract the SAML token from it.

The URL has the following format:

http://localhost?access_token=saml-access-token

Where saml-access-token is the base64-encoded SAML access token.

Registering or Authenticating the User

After you obtain an SAML token from the AD FS STS, you can use the loginWithAdfs() method overload that accepts a Base64-encoded token.

On first invocation, loginWithAdfs() registers the user. Consequent invocations for the same user authenticate the user.

On success, the method returns an object containing a Telerik Platform access token (not to be mistaken with the AD FS SAML security token) that can be used with further Backend Services iOS SDK operations. In that, the loginWithAdfs method behaves similarly to the login method.

[EVUser loginWithAdfs:token block:^(EVUser *user, NSError *error) {
    //in case of successful login the user object has isAuthenticated=true
}

See Also

External resources:

Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.