Add sign-in GeographicalContext data as custom claim?

I’m using a custom authorization server and would like to add a custom claim to the id token that contains the country that the user signed in from. I can see in the logs that this info is captured under Client | GeographicalContext | Country/region, but I’m not sure what expression to use to add this data point into the token. Is this data available for using in a claim?

This type of information won’t be accessible to pull into a claim directly, but you could look to use Token Inline Hooks to add the claim dynamically into the tokens before they are issued.

Thanks for the idea. Inline hooks look interesting, but from what I can tell they are all about adding something into the token from outside of Okta, so data that our hook service would supply correct?

I’m looking to tap into the data that Okta collects during sign-in, specifically the country of the user authenticating. I would not have this information in my hook service, as I’m trying to use the country information that Okta is already collecting during authentication.

So it sounds like the answer is that the information that you collect during authentication is just not available to us, outside of accessing the log files?

Specifically this?

Thats what it looks like based on the sample requests to the token hook endpoint from our docs. In which case, you could have your hook service make calls to our /logs endpoint to capture these details, that way you can add them into the token.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.