Setting up access to an SAML app in Yandex Identity Hub
To grant access to a SAML app, assign roles to subjects. Learn what roles the service has and assign the required ones.
- Log in to Yandex Identity Hub
. - In the left-hand panel, click
Apps and select your app. - Navigate to the Access bindings tab.
- Click Assign roles.
- In the window that opens, select the group, user, or service account to which you want to give access to the app.
- Click
Add role and select a role. Add other roles as needed. - Click Save.
Alert
The set-access-bindings command for assigning multiple roles completely rewrites access permissions for the resource. All current resource roles will be deleted.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
View the description of the CLI command for assigning roles for a SAML application:
yc organization-manager idp application saml application set-access-bindings --help -
Get a list of SAML apps and their IDs:
yc organization-manager idp application saml application list --organization-id <organization_ID>Where
--organization-idis the ID of the organization you need the list of SAML apps for. -
Get the ID of the user, service account, or group to which you are assigning roles for the SAML application.
-
Use the
yc organization-manager idp application saml application set-access-bindingscommand to assign the following roles:yc organization-manager idp application saml application set-access-bindings \ --id <app_ID> \ --access-binding role=<role>,subject=<subject_type>:<subject_ID>Where:
-
--id: ID of the SAML application to grant access to. -
role: ID of the role you need to assign. -
subject: Subject getting the role.Subject designations
To indicate a subject, use a combination of its type and unique ID, i.e.,
<subject_type>:<ID>. How you can designate a subject:Subject type
Subject designation
userAccountuserAccount:<user_ID>serviceAccountserviceAccount:<service_account_ID>federatedUserfederatedUser:<user_ID>groupgroup:<group_ID>systemsystem:allAuthenticatedUsers(
All authenticated usersgroup)system:allUsers(
All usersgroup)system:group:organization:<organization_ID>:users(
All users in organization Xgroup)system:group:federation:<federation_ID>:users(
All users in federation Ngroup)system:group:userpool:<pool_ID>:users(
All users in userpool Pgroup)
Provide a separate
--access-bindingparameter for each role. Here is an example:yc organization-manager idp application saml application set-access-bindings \ --id <app_ID> \ --access-binding role=<role1>,service-account-id=<service_account_ID> \ --access-binding role=<role2>,service-account-id=<service_account_ID> \ --access-binding role=<role3>,service-account-id=<service_account_ID> -
Alert
The setAccessBindings method for assigning multiple roles completely rewrites access permissions for the resource. All current resource roles will be deleted.
Use the Application.SetAccessBindings REST API method for the Application resource or the ApplicationService/SetAccessBindings gRPC API call.
Provide the following in the request:
-
Role in the
accessBindings[].roleIdparameter. -
ID of the subject getting the role for the SAML application in the
accessBindings[].subject.idparameter. -
Type of the subject getting the role for the SAML application in the
accessBindings[].subject.typeparameter.Subject designations
To indicate a subject, use a combination of its type and unique ID in the
subject.typeandsubject.idfields of the request. Possible combinations:subject.type
subject.id
userAccount<user_ID>serviceAccount<service_account_ID>federatedUser<user_ID>group<group_ID>systemallAuthenticatedUsers(
All authenticated usersgroup)allUsers(
All usersgroup)group:organization:<organization_ID>:users(
All users in organization Xgroup)group:federation:<federation_ID>:users(
All users in federation Ngroup)group:userpool:<pool_ID>:users(
All users in userpool Pgroup)