Identity

Overview

The Identity service is an essential YaaS service. Use it to register custom identity providers for your organization.

Create and register a custom identity provider for your organization to allow your users to use YaaS with their existing accounts. With a properly configured custom identity provider in place, the YaaS OAuth2 service communicates with a remote user base to issue tokens. This allows your users to access the resources within the context of the organization for which you registered the identity provider without the need to create a new account to use with YaaS.

You can register multiple identity providers for a single organization. The custom identity provider is bound to the organization for which you register it. Using a custom identity provider, you can get tokens only for the organization you registered the custom identity provider for, as well as for all projects in that organization.


API Reference

/registration-metadata

/registration-metadata

get

Get the YaaS OAuth2 service configuration metadata. You must register this metadata in the identity provider to establish successful communication between the identity provider and the OAuth2 service.

/providers

/providers

get

Use this endpoint to fetch all identity providers registered for your organization in YaaS.
Security/Access Control: To access this method, an access token must be issued for the requested organization, and have the hybris.org_manage scope.

post

Use this endpoint to register a new identity provider for your organization in YaaS.
Security / Access Control: To access this method, an access token must be issued for the requested organization, and have the hybris.org_manage scope.

/providers/{id}

get

Use this endpoint to fetch information about the identity provider with the specified ID.
Security/Access Control: To access this method, an access token must be issued for the organization which owns the identity provider, and have the hybris.org_manage scope.

put

Use this endpoint to update the identity provider's information.
Security / Access Control: To access this method, an access token must be issued for the organization which owns the identity provider, and have the hybris.org_manage scope.

delete

Use this endpoint to delete a registered identity provider.
Security / Access Control: To access this method, an access token must be issued for the organization which owns the identity provider, and have the hybris.org_manage scope.


Register a Custom Identity Provider

The process of registering a custom identity provider in YaaS consists of three basic steps:

  1. Get the registration meta-data for the OAuth2 service.
  2. Create a client in your identity provider and obtain the client ID and client secret.

  3. Register your custom identity provider in the Identity service.

  4. Get the registration meta-data from the OAuth2 service

    To get the meta-data required to register a custom identity provider in YaaS, you must to call the /registration-metadata endpoint of the Identity service.

    This is a sample request to the /registration-metadata endpoint. It is an open resource, which means that you don't have to include an access token when you call this endpoint.

    curl -X GET "http://api.eu.yaas.io/hybris/identity/v1/registration-metadata"

    The response includes an array of redirectURIs and an array of postLogoutRedirectURIs. To ensure that you use up-to-date information, call the /registration-metadata endpoint every time you register a new custom identity provider for your organization.

    Create a client for your identity provider and obtain the client ID and client secret

    Create a new client in your custom identity provider. Use the meta-data you obtained from the /registration-metadata endpoint.
    Get the client ID and client secret from the newly created client. You need this information to register your custom identity provider in YaaS.

    Register your custom identity provider in the Identity service

    To register your custom identity provider, you must call the /providers endpoint of the Identity service. The request must include an access token issued for the organization for which you want to register the custom identity provider. The token must also include the hybris.org_manage scope.

    Pass the OpenID configuration, client ID and client secret you obtained from the client you created in the previous step. Additionally, include the display name of your custom identity provider.

    This is a sample identity provider registration request to the /providers endpoint. Line breaks are added for better readability.
    curl -X POST "http://api.eu.yaas.io/hybris/identity/v1/providers" \
    -H 'Authorization: Bearer ACCESS_TOKEN_HERE \
    -H 'Content-Type: application/json' \
    -d '{"displayName":"My IDprovider","credentials":{"clientId":"a9883977-97e3-44d9-a4cb-7c2df0f7a267","clientSecret":"2loftph991j058u3"}, \
    "openidConfiguration":{"issuer":"https://someorg.io","authorization_endpoint":"https://someorg.io/authorize", \
    "token_endpoint":"https://someorg.io/token","jwks_uri":"https://someorg.io/jwks"}}' \
    


    The successful response from the Identity service confirms the registration of the custom identity provider and returns the alpha-numeric ID of the custom identity provider, as well as a link to the registered provider. This is a sample code 201 response from the service:

    {"id":"594b8c8176b391a1c5c6344a","link":"https://api.eu.yaas.io/hybris/identity/v1/providers/594b8c8176b391a1c5c6344a"}


    Use the custom identity provider

    After you successfully register your custom identity provider in the Identity service, you can use it with the Implicit Grant and the Authorization Code Grant authorization flows available in YaaS.

    For more information about the authorization flows available in YaaS, see the Grants section of the OAuth2 service documentation.

    To use your custom identity provider, provide the ID you received in the code 201 successful response from the Identity service as the value of the hybris_id_provider parameter in the request to the OAuth2 service.
    This example shows an Authorization Code Grant flow access token request that uses a custom identity provider:

    curl -i -X GET 'https://api.eu.yaas.io/hybris/oauth2/v1/authorize?response_type=code&client_id=CLIENT_ID&scope=SCOPE_NAME&state=STATE&hybris_id_provider=724987custom_idp_id09u'


    • Send feedback

      If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.

    • Get Help

      Use our private help channel. Receive updates over email and contact our specialists directly.

    • hybris Experts

      If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.