Kony Fabric identity supports OAuth 2.0 protocol for authenticating back-end identity providers that support RFC6749
. For more details, refer to https://tools.ietf.org/html/rfc6749
With Kony Fabric OAuth 2.0 identity service, a user can access some of the external OAuth service providers such as Salesforce, Google, Amazon, Microsoft, Instagram, Yahoo, and Box for authentication.
Based on the user's request made by using SDKs, the Kony Fabric OAuth 2.0 identity service selects the Web server authorization grant flow (3-legged OAuth) for performing user authentication.
Example for 3-legged OAuth: When a user logs into a Kony Fabric application by using the Google OAuth endpoint, the authorization service (for example, Google OAuth endpoint) redirects the user to Google login page. During this stage, the callback URL is also set. The user enters login details such as userID and password. After successful authentication, the user is logged into Google account. Based on the Kony Fabric OAuth 2.0 identity configuration, identity service filters the user profile data from Google and stores the details in the identity session.
User Profiles in Kony Fabric OAuth 2.0
Different service providers implement user profiles as per their own standards. Kony Fabric OAuth 2.0 identity service retrieves user attributes from a user profile and saves these attributes in Kony Fabric Identity Sessions after successful login response.
Note: A profile endpoint provides the profile of the logged in user.
Kony Fabric OAuth 2.0 helps users to configure authorization provider to access User Profile data in one of the following ways:
Advantages of Kony Fabric OAuth 2.0 identity service
You can use the OAuth 2.0 identity service to retrieve and save user attributes in Kony Fabric identity sessions after a successful login response, and then use the attributes as client filters during Offline Sync calls.
Note: If you enable synchronization capability in your app, Kony Fabric OAuth 2.0 identity service uses the user attributes retrieved from the user profile as client filters during Offline Sync calls.
For example, the logged in user's role (such as Manager or Employee of an organization) received as part of a User Profile after a successful OAuth login can be used as a client side filter for Offline Sync. For more details, see the Synchronization > client side filters topic.
Note: To configure Okta identity service, you can the same steps provided for the Auth 2.0 Identity Service section as well.
To configure an identity service using Kony Fabric OAuth authentication mode, follow these steps:
Note: Fields marked with an asterisk are required.
Authorization code: An authorization code grant type is used if the client wants to request access to protected resources on behalf of another third-party user. When the client requests for the authorization, the authorization server redirects to the third party URL. The client enters the authorization code and gains access to the protected resources.
Password: On selecting this grant type, the client needs to provide the Token Endpoint. The client provides their access credentials to access the URL provided in the Token Endpoint. These credentials are validated by the back-end server. If the credentials are valid, it redirects back to the Console.
JWT Bearer: When the JWT bearer grant type is selected, the provider picks the existing identity provider and pass the values as input to JWT bearer provider for the response. Apart from client specified parameters, the system picks the existing MF auth token and gets the relevant values from the session. The values are passed as input to the current JWT bearer provider login. The existing identity session is selected from the Token Identity provider drop-down menu.
Extension: When the extension grant type is selected, the system displays the Extension Grant text box to enter the grant type value. For extension grant type, the oAuth does not have any fixed value. The grant type value is dynamic, which is a client specified parameter.
https://accounts.google.com/o/oauth2/auth
https://accounts.google.com/o/oauth2/token
https://<accountID>.auth.konycloud.com/OAuth2/Callback
Note: Provide domain as a service URL.
For example, configure your Google app to accept requests from authentication service by typing the auth.konycloud.com
in the App Domain text field.
In the Scope text box, enter the list of permissions that a user needs to agree to while in the user log-in page of the OAuth 2.0 service provider - for example, Gmail. The list can contain more than one permission and depends on the authorization server. For a sample of full list of permissions, refer to OAuth 2.0 standards.
For example, if you configure the email
permission as scope, after you log in Google for the first time, Google displays the Log in with Google dialog with the configured permissions. Click OK to share your permissions (public profile and email) with Kony Fabric.
Note: If you enable synchronization capability in your app, Kony Fabric OAuth 2.0 identity service uses the user attributes from the user profile as client filters during Offline Sync calls. For example, User Role (one of the attributes of the user profile) received as part of User Profile after a successful OAuth 2.0 login can be used as client side filter for Offline Sync. For more details, refer to Synchronization > client side filters.
Custom User Attribute Selectors: Enter custom attributes to add more attributes in addition to the ones defined above. For example, groups=user.groups
to define a custom attribute with name groups
and maps to user.groups
JSON path in backend profile response.
Note: The parameters in User Attribute Selectors are supported in JSON path format.
// Sample profile response in JSON format
{ "id": "0001", // federation ID of the user "name": { "first":"John", // first name of the user "last":"Doe", // last name of the user "display":"john.doe" // display name of the user }, "email": // email ID of the user [ "john.doe@gmail.com", "john.doe@hotmail.com" ], "phone": "1234567890", // phone number of the user
"picture": "picture", //"https://my-company.com/profile/picture/1002"
}
// Sample profile attributes selectors for the above response
"federation id": "id" "first name":"name.first" "last name": "name.last" "display name":"name.display" "phone":"phone" "email":"email[0]"
// Sample custom attributes selectors for the above response
"federation id": "id" "first name":"name.first" "last name": "name.last" "display name":"name.display" "phone":"phone" "email":"email[0]"
"picture": "https://my-company.com/profile/picture/1002"
Redirect URL on successful authentication:
URL: In the URL text box, enter the allowed URLs.
authorization request
, token request
, or profile request
as header, body, or query parameters.Note: You can add an entry by clicking the Add button if entries for the input and the output tabs do not exist.
To delete an entry, click the Delete button at the end of that entry.
To delete a group of entries, select the check boxes for the entries, and then click the Delete button under the Additional Parameters section.
The value set as a part of the configuration is sent in the selected request.
value
from the client request.The value field in the configuration will be disabled. When the client tries to login, the request must contain the parameter in the request body.
For this mode to work, Kony Fabric should at least have two identity providers associated with it. The value in the provider configuration will be of the following pattern:<Provider Name>.<profile|security>.<Attribute Name>.
Based on the above configuration, the value is picked up from the identity session.
After entering the above details, click on the TEST LOGIN button to verify the credentials.
If you have not logged in to your the social identity service (for example: Gmail), the Console redirects you to the back-end identity provider’s log-in page. Enter your credentials as required.
The test results are displayed in the Identity Response dialog.
Note: You can view the service in the Data Panel feature of Kony Visualizer. By using the Data Panel, you can link back-end data services to your application UI elements seamlessly with low-code to no code. For more information on Data Panel, click here.
If you configure an OAuth 2.0 identity service in Kony Fabric for a mobile app, the mobile app needs to use OAuth to authorize and authenticate users before they access any APIs. You can test the login for the OAuth identity provider in the OAuth Identity service definition tab. As a response to the login, you can view the identity response and the profile and token response that you get from the backend. Also, you can use the information from the backend profile response to help you configure the user profile under User Attribute Selectors.
The primary benefit of testing the login is that you will know if there is a problem with the URL or other configuration errors during the configuration of the OAuth 2.0 connector. You can use the details captured from the response to troubleshoot and resolve any problems with the OAuth 2.0 connector.
To test a Kony Fabric OAuth 2.0 identity service, do the following:
A sign in screen for the OAuth 2.0 service appears. For example, the sign in screen for your Google account.
An alert indicates a successful login and a pane appears that has tabs for Backend Token Response, Backend Profile Response, Identity Response. If your sign in failed, the error message that appears provides information about the failure.
Important: If a custom integration service (for example, MongoDB or RAML) is linked to an OAuth2 identity service, while testing an operation of the integration service from Kony Fabric Console, you must pass the x-kony-oauth2-access-token
as a header and access_token
as a header value.
Also, If a custom integration service (for example, MongoDB or RAML) is linked to an OAuth2 identity service, while testing an operation of the integration service from Admin Console, you must pass the x-kony-oauth2-access-token
as a header and access_token
as a header value.
For example:
Note: For more information on how you can integrate Kony OAuth Provider, User Repository, and OAuth 2.0 Identity services to create a basic login form, refer to a Base Camp article: Exploring Kony OAuth Provider.
Copyright © 2020 Kony, Inc. All rights reserved. |