Get oAuth2 token based on Authorization Code

mihai.valceamihai.valcea Member Posts: 95
edited 2022-10-31 in NAV Three Tier
Hi,

I'm using a NAV routine to get Authorization code (oAuth2 protocol).
How can I convert this authorisation code into Token used further for API requests ?

The authorisation code is available in next context:
1. in browser there is a callback like this: https://localhost/v1/callback?code=45a2bb54a665a4e9193eb662c5751dffd65e9ee40c823debaaaa716fd79ecf68
2. in response content is like this:
<path d="M43.875 5.37327C43.875 2.54484 41.6154 0.25 38.8258 0.25C37.2459 0.25 35.837 0.987934 34.9103 2.14009L34.9084 2.13816L16.7115 24.8158L8.88268 16.2132L8.87889 16.2171C7.95606 15.2036 6.64012 14.5659 5.17421 14.5659C2.38477 14.5639 0.125 16.8567 0.125 19.6872C0.125 21.0282 0.637698 22.2439 1.46749 23.1572L1.46369 23.161L13.2421 36.1026L13.2459 36.0988C14.1687 37.1122 15.4847 37.75 16.9506 37.75C18.5304 37.75 19.9394 37.0121 20.866 35.8599L20.8679 35.8618L42.7428 8.60646L42.7409 8.60453C43.4492 7.724 43.8745 6.59882 43.8745 5.37342L43.875 5.37327Z" fill="white" transform="translate(28, 32)"/>

It seems that Postman has some conversion mechanism to convert the authorization code into Token.
Is possible to have the Token directly in NAV or I need to use Postman for every token generation ?

Regards,
Mihai
Sign In or Register to comment.