<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00008WWm9DCATOkta Classic EngineSingle Sign-OnAnswered2025-09-13T09:01:51.000Z2022-12-14T10:54:59.000Z2022-12-14T13:40:46.000Z
How to distinguish in SAML assertion the organisation from which users are using the SSO sign in?

I have a SP-initiated SSO Application using SAML that is going on to the Okta Integration Network. The app/SSO sign-in is working. Now supposed it is on OIN, Company A and Company B added my app and assigned their users to use the app to access my service: in what way can I know whether a user is from Company A or Company B? I don't see anything obvious in the SAML assertion. This is without trusting the usernames provided (I can go to Okta Directory, People, and create myself a "president@whitehouse.gov" without much of a question. I am not trusting the usernames).

 

I had also an idea when looking at the Okta Expression Language overview:

https://developer.okta.com/docs/reference/okta-expression-language/

It references the use of "org.name" and "org.subDomain". However when I tried them under SAML Settings, Attribute Statements, the page reported "The expression is invalid: Property 'org' not found". So, Okta Expression Language doesn't work here.

 

What other options do I have to identify which company/organisation a user is logging in from?

Use case scenario: internal security and auditing of users accessing my service.

 

 


  • a0n5s (a0n5s)

    Is your application mutliple tenant like Okta? for Okta, different customer with different tenant and with different url. so it can redirect to different url. I think every company like company A and B have different SAML configuration, So it can set different Okta tenant url.

    the Okta expression is very powerful. it can like this:

    String.replace("acs:ram::<account_id>:role/$approle,acs:ram::<account_id>:saml-provider/okta-provider", "$approle", appuser.approle)

    the customer can set as this:

    String.replace("acs:ram::177242285274****:role/$approle,acs:ram::177242285274****:saml-provider/okta-provider", "$approle", appuser.approle)

    Expand Post
This question is closed.
Loading
How to distinguish in SAML assertion the organisation from which users are using the SSO sign in?