OIDC SSO configuration

Updated at:

This document describes how to configure single sign-on (SSO) using the OpenID Connect (OIDC) protocol.

Note

To learn about the SSO protocols supported in IDaaS, see Standard protocols.

OIDC grant types

You can select one or more of the following grant types:

Grant type

Description

Client credentials

client_credentials

The client credentials grant type allows an application to exchange its client_id and client_secret for a token to call Developer APIs that are enabled for the application in IDaaS.

This grant type is enabled automatically when you enable APIs for the application, so you do not need to select it.

Authorization code

authorization_code

The authorization code is the most common grant type for OIDC applications in IDaaS. The application delegates the sign-in process to IDaaS and then parses the returned id_token to verify the user's identity.

Refresh token

refresh_token

This grant type allows an application to use a refresh_token to obtain a new access_token, which extends the session lifetime. It is typically used with the authorization code grant type.

Device flow

device

The device flow is for applications that lack a browser-server architecture. If a device cannot display the IDaaS sign-in page, this flow lets the user sign in from a browser on a separate device.

For standard web-based enterprise applications, we recommend that you select the authorization code and refresh token grant types.

For applications without a browser-server architecture, we recommend that you select the device flow and refresh token grant types.

Note

IDaaS does not currently support other OIDC grant types. If you require a different grant type, you can submit your request. Requests are evaluated and prioritized based on urgency and importance.

IDaaS configuration

​

Parameter

Description

Example

Basic Settings (required)

Grant types

Select the grant types that the application will use.

Select: Authorization Code

Select: Refresh Token

Redirect URIs

An allowlist of URIs where users can be redirected after authentication. When an application requests to sign in, the redirect_uri parameter it sends must exactly match a URI in this list.

http://www.xxxx/oidc/sso

http://www.xxxx/oidc/sso2

Authorization Scope

For more information, see SSO overview.

Select: All Users

Advanced Settings (optional)

Scopes

scopes

Defines which user information the application can retrieve from the UserInfo Endpoint after a user signs in.

  • openid

  • email

  • phone

  • profile

Select: openid

Select: email

Select: profile

PKCE

This option is available when the authorization code grant type is selected. If enabled, the authorization code flow uses the more secure Proof Key for Code Exchange (PKCE) extension.

Not selected by default.

Code validity period

  1. The application exchanges the code for a token. You must set a reasonable validity period for the code.

  2. Rules:

    • Minimum value: 60 seconds (1 minute).

    • Maximum value: 30 minutes (1,800 seconds).

  3. Input format and default behavior:

    Enter a positive integer. The system automatically validates the input and adjusts values that are out of range based on the selected unit:

    • Unit: minutes

      • If the value is less than 5, the system automatically sets it to 5 minutes.

      • If the value is greater than 30, the system automatically sets it to 30 minutes.

    • Unit: seconds

      • If the value is less than 60, the system automatically sets it to 60 seconds.

      • If the value is greater than 1,800, the system automatically sets it to 1,800 seconds.

  • Unit: minutes

    If you enter 3, the effective value is 5 minutes.

    If you enter 40, the effective value is 30 minutes.

  • Unit: seconds

    If you enter 30, the effective value is 60 seconds.

    If you enter 2000, the effective value is 1,800 seconds.

Code challenge

method

This option appears only when PKCE is enabled. It specifies the method used to generate the Code Challenge for the PKCE extension.

-

access_token

validity period

The application uses the access_token to call IDaaS APIs. It is valid for 2 hours by default. After it expires, the application must use a refresh_token to obtain a new one; otherwise, the user must sign in again.

2 hours

id_token

validity period

The id_token is a JSON Web Token (JWT) that verifies a user's identity. The application validates the token's signature using a public key. After the token expires, you must use a refresh_token to obtain a new one, or the user must sign in again.

10 hours

refresh_token

validity period

Used to obtain a new access_token and id_token. After the refresh_token expires, the user must sign in again.

30 days

Extended id_token

fields

You can extend the id_token payload to include basic, non-sensitive user information. This practice avoids repeated calls to the UserInfo Endpoint. For more information, see Rules for the values of extended OIDC id_token fields.

Note

Any fields added to the payload are publicly visible, so use this feature with caution.

-

id_token

signing algorithm

Specifies the asymmetric algorithm for signing the id_token. IDaaS currently supports only RSA-SHA256.

RSA-SHA256

SSO Initiator

Specifies whether the application or the IDaaS portal initiates the SSO flow.

Application Only

IDaaS Sign-In URL

If you allow SSO to be initiated from both the portal and the application, you can enter a sign-in URL. This is the application URL where IDaaS should redirect users to start the SSO flow. Upon receiving the request, this URL must immediately redirect to the IDaaS /authorize endpoint.

-

Application configuration

Using the OIDC protocol, applications authenticate by calling a standard set of endpoints provided by IDaaS.

The following table describes the available endpoints.

Parameter

Description

Example

Issuer

A field in the id_token that identifies the token issuer. This value also serves as the base URL for the endpoints listed below.

https://xxxxx.aliyunidaas.com/oidc1

Discovery Endpoint

Discovery

Retrieves metadata about the OIDC configuration, such as endpoint locations and supported parameters. This endpoint is publicly accessible.

https://xxxxx.aliyunidaas.com/oidc1/.well-known/openid-configuration

Authorization Endpoint

Authorization

The endpoint where the application initiates the SSO flow by redirecting the user.

https://xxxxx.aliyunidaas.com/oidc/authorize

Token Endpoint

token

In the single sign-on (SSO) process, after the application obtains the authorization code code, it calls the token API from the backend.

https://xxxxx.aliyunidaas.com/oidc/token

JWKS endpoint

JWKS

The JSON Web Key Set (JWKS) endpoint provides the public key for verifying the id_token signature. Key rotation is not supported.

https://xxxxx.aliyunidaas.com/oidc1/jwks

UserInfo Endpoint

Userinfo

After a user signs in, the application calls this endpoint with an access_token to retrieve basic user information.

https://xxxxx.aliyunidaas.com/oidc1/userinfo

End Session Endpoint

SLO

Signs the user out of their main IDaaS session.

https://xxxxx.aliyunidaas.com/oidc1/logout