Hello! We are looking to switch auth providers, an...
# ask-a-descoper
n
Hello! We are looking to switch auth providers, and we're trying to figure out if descope will work for our use case. We have ~500 tenants, each of which has their own third party app registration with our existing auth provider, which we will need to migrate. The tokens for each need to have the same set of custom claims, but the values are tenant-specific. It looks like you can't assign an inbound app to "belong" to a particular tenant - is this correct? If so then using a generic template for all of the app registrations won't work as we can't access the tenant context, and it looks like our options are to use access keys (undesirable as it doesn't fit nicely into the existing client_credentials paradigm that we're using), or to create a JWT template for every app registration with the tenant specific information hard-coded. Is there a third option we're missing? Thanks in advance!
m
@Tal Kapitolnik can you help here ?
k
Hey @Nick Osman, I think the confusion lies in that we don’t assign applications to Tenants, but rather SSO connections are associated with Tenants, but there are a few ways you can associate a particular user with a particular tenant: • This can be done automatically using the domain name of the email address (e.g. @descope.com email addresses -> assigned to Descope tenant) • This can be done within the Flow itself (e.g. an appId or tenantId parameter is passed into the flow and a user can be assigned to a tenant that way, or by querying an application database, etc. a lot of flexibility here) Further, we do support tenant specific claims in tokens. You’ll notice in the dashboard roles can be defined both in the project level and at a tenant level, so that tenant level context you’re looking for should be preserved in Descope.
n
Thanks for your response! These app registrations all use a client_credentials flow, so there is no logged in user - what would be your suggested solution in this case?
k
Ah, so this is for M2M clients. I see what you mean, for each inbound app you can create the scopes that will be provided, I think you could just append the tenant id in front of the scope (e.g. tenantId_scope). Does that make sense @Tal Kapitolnik or is there a simpler way to have tenant context with our inbound apps?
t
I think the easiest way to do it is to use our access keys but with the client credentials flow, so it won't break your pradigm. You can create the access key for your required tenant and get an access token by calling the
/oauth2/v1/token
endpoint with the client ID and secret, as described here: https://docs.descope.com/getting-started/oidc-endpoints#client-credentials-flow Is it what you are looking for?
n
Thanks guys, that's very helpful!