Skip to main content

HelloID

Retrieve the on-behalf token (optional)

You can store the on-behalf-of and on-behalf-of-refresh tokens from Azure AD inside HelloID user attributes. In this way, the tokens can be passed through to any SSO application that users log into from HelloID. The application can then use these tokens to directly access the Azure Graph API on behalf of the users, without requiring re-authentication.

For more information, see Microsoft identity platform and OAuth 2.0 On-Behalf-Of flow.

As prerequisites, you must have already done the following:

It is recommended to use multiple browser tabs while following these instructions. You will be copying and pasting several values between Azure AD and HelloID.

  1. In HelloID, go to Security > Authentication > Identity providers.

  2. Select the Edit link for the Azure AD OIDC IdP.

    mceclip1.png
  3. Select the Configuration tab.

  4. Turn on the Retrieve 'On-behalf-of' token and store to user attributes toggle. This automatically adds and maps onbehalfoftoken and onbehalfofrefreshtoken attributes to all users who log in via the Azure AD IdP, without requiring you to manually add these attributes to the Azure OIDC IdP's mapping set. Leave this browser tab open, without selecting the Save button yet.

    mceclip1.png
  5. In a new browser tab, go to Azure Active Directory > App registrations in your Azure portal.

  6. Select the HelloID app that you registered earlier (see Azure AD (OIDC) IdP)

  7. Copy its Application (client) ID to a separate notepad app. You will need it shortly.

  8. In Azure AD, go back to App registrations.

  9. Select the target app which users will SSO into from HelloID (the app to which the on-behalf-of tokens will be passed).

  10. Select the Expose an API link.

  11. Select the Add a scope link.

  12. Accept the default Application ID URI. Select the Save & continue button.

  13. Enter your desired scopes.

  14. Select the Add scope button to confirm.

  15. Copy the api:// value which appears under the Scopes column in the Azure AD Expose an API screen. (For example: api://37c086f5-bdc7-4f88-955c-49cb7c3d711d/Files.Read)

  16. In HelloID, paste it into the On Behalf of Scopes field of the Configuration tab.

    mceclip2.png
  17. Select the Save button.

  18. In Azure AD, return to the Expose an API page for the target application.

  19. Select the Add a client application button.

  20. Paste the HelloID app's Application (client) ID value you copied in step 7 into the Client ID field.

  21. Under Authorized scopes, select the check box for the scope you created in step 13.

  22. Select the Add application button to confirm.

  23. Select the Certificates & secrets link.

  24. Select the New client secret link.

  25. Enter a Description and an expiration period.

  26. Select the Add button to confirm.

  27. Copy the client secret that appears under the Value column.

  28. In HelloID, paste it into the On Behalf of Client Secret field of the Configuration tab.

    mceclip3.png
  29. Select the Save button to confirm.

  30. Go to Directory > Mapping sets and select the Edit link for the target application which will require these tokens. For example:

    mceclip7.png
  31. Select the Change attributes link to add On behalf of and On behalf of Refresh attributes with onBehalfOf and onBehalfOfRefresh for the External Field values, respectively. Learn more about mapping sets here.

    mceclip8.png
    mceclip13.png
  32. Select the Close button when done.

  33. Select the Change mappings link to map the newly-created user attributes as follows:

    User Attribute

    HelloID Claim Set Variable

    {{user.attributes.onbehalfoftoken}}

    On behalf of

    {{user.attributes.onbehalfofrefreshtoken}}

    On behalf of Refresh

    mceclip14.png
  34. Select the Close button when done.

  35. Select the Save button to confirm.

The on-behalf-of and on-behalf-of-refresh tokens will now be passed through to the configured application when an end user selects it in the Applications tab of the HelloID end user dashboard. The application will have access to the Azure Graph API without any additional authentication by the user.