<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
0D5KZ00000NfX3P0AVOkta Classic EngineIntegrationsAnswered2026-02-07T09:00:30.000Z2025-03-20T17:01:59.000Z2025-03-20T22:08:09.000Z

9ri0q (9ri0q) asked a question.

Accessing Custom User Attributes and Details from Spring Security Context Object

Hi, I've seen some pretty great exemplars on how to access user attributes from Okta using Pre authorization token scopes and whatnot, but I don't see any info about how to access them from the security context object. We want to make Okta backwards compatible with our in-house authorization server and are hoping to access all these details from the same place (which is the security context) but I'm having a hard time figuring out how to do this. I did see some support questions on the Ask Okta forum such as this: https://devforum.okta.com/t/okta-add-user-details-token-info-to-security-context/9549 but I can't seem to find an exemplar on how to handle that and am confused how the auto configuration even handles placing these attributes in the details. We don't necessarily want to include all these attributes in the token either as claims. Instead we want to query the authorization server to get certain custom attributes that are sensitive and private to the user.


  • User17157611498146715886 (Customer Support Online Community and Social Care)

    Hello @9ri0q (9ri0q)​ , thank you for contacting Okta Community!

     

    It looks like your question is more appropriate for our dedicated Okta Developer Forum. I advise reaching out via devforum.okta.com  as they will have more insight into this topic. 

     

    Alternatively, you could open a Support ticket (Customer Support Account ID number required) so one of our engineers can analyze it and provide in-depth troubleshooting. You could also provide more details in a ticket that shouldn’t be given here, as this is a public space.

    Please note that opening a support ticket is a feature available only to paid accounts. If you do not have a paid account, but are interested in upgrading, you can contact our Sales team

     

    Regards. 

    --

    Help others in the community by liking or hitting Select as Best if this response helped you

    Expand Post
This question is closed.
Loading
Accessing Custom User Attributes and Details from Spring Security Context Object