web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Does anyone have experience on IOAuthHelper to get user Token in X++?

(0) ShareShare
ReportReport
Posted on by 85

I tried to use the below code to get the user Token  in D365 X++, but it always return  null,  not sure what is wrong,  Does anyone have idea on this?

get-token.png

Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    What are you trying to achieve by your code? What would you do with the token? What's the namespace of OAuthHelperFactory?

    By the way, please separate tags by comma; you created a single long tag (I've already fixed it).

  • Fred Xu Profile Picture
    85 on at

    Hi Martin,

    We want to get the user token in D365 and pass it to a web service call. the namespace of OAuthHelperFactory is"Microsoft.Dynamics.AX.Security.AuthenticationCommon".

    Thanks,

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    As I already asked on Yammer, what do you mean by the user token? I'm not aware of any such term in OAuth. There are access tokens, refresh tokens and so on, but no user tokens.

    If you mean getting the access token for AX, it's useless for calls to other services, therefore your technical solution isn't achievable. If you tell us what business problem you're trying to solve, maybe we'll be able to suggest a solution that would actually work.

  • Fred Xu Profile Picture
    85 on at

    We want to get the user AD token and replace a palceholder in  web service URL.

    get-token2.png

    Thanks

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    I'm sorry, but I can't help you until you answer my question.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans