Identifying Login Method (SSO or Credentials) Programmatically

Hi Team,

Once a user is logged in via SSO, is there any service or API available that allows us to programmatically determine whether the user logged in using SSO or standard credentials?

Thanks,
Rahul

Hi @rmishra1,

an SSO user account, can be identified by the customProperties.userOrigin property of the user being set to OAUTH2.
So after requesting the current user via: Cumulocity - OpenAPI

You should be able to tell if the user is an SSO user or not.

In case you are using the Web SDK, you can use the getCurrentUserLoginMode method of the TenantUiService (Web SDK documentation).

Regards,
Tristan

The user origin is always being returned as ‘Basic’.

So team, please help me how to get “OAUTH2” in origin

Hi @rmishra1,

are you sure that the user account you’ve been using is an SSO account?

Can you confirm that in your administration app? The user list should show you a hint in case the user is actually an SSO user:

Regards,
Tristan