Creating an OIDC application in Yandex Identity Hub for integration with Selectel
To enable your organization users to authenticate in Selectel through OpenID Connect (OIDC), create an OIDC application in Yandex Identity Hub and set up Selectel integration.
OIDC apps can be managed by users with the organization-manager.oauthApplications.admin role or higher.
To enable single sign-on in Selectel:
Create an app
- Log in to Yandex Identity Hub
. - In the left-hand panel, select
Apps. - Click
Create application and do the following in the window that opens:- Select the OIDC (OpenID Connect) single sign-on method.
-
In the Application type field, select Web Application.
OIDC apps of the
Web Applicationtype are optimized for user authentication to external web apps with a server end (backend), where the application secret can be safely stored. For more information about OIDC application types, see Types of OIDC apps in Yandex Identity Hub. - In the Name field, enter the application name:
selectel-oidc. - In the Folder field, select the folder where you want to create an OAuth client for your app.
- Optionally, in the Description field, enter a description for the new app.
- Click Create application.
Set up the integration
Get the application’s credentials
- Open the OIDC app you created.
- Under Overview on the Identity provider (IdP) configuration tab, expand the Additional attributes section and copy the ClientID value.
-
Create an app secret (only available for applications of the
Web Applicationtype).To do this, under App secrets, click Add secret, and in the window that opens:
-
Optionally, add a description for the new secret.
-
Click Create.
The window will display the generated application secret. Save this value.
Warning
If you refresh or close the application information page, you will not be able to view the secret again.
If you closed or refreshed the page before saving the secret, click Add secret to create a new one.
To delete a secret, in the list of secrets on the OIDC app page, click
in the secret row and select Delete. -
Create a federation in Selectel
Note
To create a federation in Selectel, you must be an account owneriam.admin
To set up a federation:
-
Log in to the Selectel control panel
. -
In the top menu, select IAM and go to Federations.
-
Click Add federation and select OpenID Connect (OIDC).
-
Under Federation settings:
- In the Name field, enter a name for the federation, such as
identity-hub-oidc. - Optionally, in the Description field, specify the federation description.
- Under Session lifetime, specify how long an authentication session will last or leave the default value (24 hours).
- In the Name field, enter a name for the federation, such as
-
Under IDP settings, specify the integration settings:
- IdP Issuer:
https://auth.yandex.cloud. - Client ID: ClientID field value you copied at the previous step.
- Client Secret: App secret you saved at the previous step.
- Auth URL:
https://auth.yandex.cloud/oauth/authorize. - Token URL:
https://auth.yandex.cloud/oauth/token. - JWKS URI:
https://auth.yandex.cloud/oauth/jwks/keys.
- IdP Issuer:
-
Disable Autocreate users, if enabled.
-
Click Create federation.
-
On the federation page, copy its ID.
Set up your application in Yandex Identity Hub
- Go back to Yandex Identity Hub
, select Apps, and openselectel-oidc. - At the top right, click
Edit and in the window that opens:-
In the Redirect URI field, enter this address:
https://api.selectel.ru/v1/auth/federations/oidc/<federation_ID>/callbackWhere
<federation_ID>is the ID of the federation you created in Selectel at the previous step. -
Under OAuth/OIDC security in Authentication methods, leave both secret transmission methods active:
Client secret basicandClient secret post. -
Under OAuth/OIDC security, disable Require PKCE.
Alert
For integration with Selectel, Yandex Identity Hub must not require the PKCE security extension during data exchange.
-
Under Scopes, select
openid,email, andprofile. -
Click Save.
-
Add users
Add users to the Yandex Identity Hub OIDC app and the Selectel federation.
Note
To manage users and groups added to an OIDC application, you need to have the organization-manager.oauthApplications.userAdmin role or higher.
Add users to the OIDC application
Tip
If you want to fine-tune user authentication in your applications, including authentication only from specific IP addresses, use authentication policies.
Authentication policies are a Yandex Identity Hub tool that allows you to flexibly configure access to applications by denying or allowing authentication for specific users in specific applications and/or from specific IP addresses. For more information, see Authentication policies in Yandex Identity Hub.
To add users:
- Open
selectel-oidcin Yandex Identity Hub . - Navigate to the Users and groups tab.
- Click
Add users. - In the window that opens, select the user or user group.
- Click Add.
Add users to Selectel
To add a user to a Selectel federation:
- Get the user ID in Yandex Identity Hub.
- Navigate to the Selectel control panel
, select IAM in the top menu and go to Control panel users. - Click Add new control panel user.
- Under User data:
- In the Login method field, select Federation (<federation_name>).
- Under External ID, specify the user ID you got at step 1.
- Under Email, specify the user email.
- Under Access settings, select the access scope and assign the required permissions
to the user. - Click Add user.
Test SSO
To verify the integration, log in to Selectel as a user assigned to the OIDC application:
- Open the Selectel login page
. - If already logged in to Selectel, sign out of your account.
- Click Sign in with SSO.
- Enter the ID of the Selectel federation you created and click Sign in with SSO.
- On the Yandex Cloud authentication page, login to your user account. The user must be directly assigned to the OIDC application or belong to a group assigned to the application.
- If Selectel prompts you for your full name on first login, enter it and click Sign in with SSO.
- Make sure you are logged in to Selectel.