OATUH 2.0 Without SDK - Authentication URL

SOLVED
Go to solution
Highlighted
New Contributor

OATUH 2.0 Without SDK - Authentication URL

I am learning how to utilize OAUTH 2.0 in my React application. In the docs I see:

let accessToken = await axios.post(
  authenticationUrl,
  querystring.stringify({
    grant_type: 'authorization_code',
    code: '[CODE]',
    client_id: '[CLIENT_ID]',
    client_secret: '[CLIENT_SECRET]'
  })
)
.then(response => response.data.access_token)

 What does authenticationUrl refer to? Is this the same as authorizationUrl as stated in step 2 or is this the url that is returned with the code after I am redirected? Thanks 

2 REPLIES 2
Highlighted
Box Employee

Re: OATUH 2.0 Without SDK - Authentication URL

Hi @dhebert-dev,

 

It looks like a line may be missing in that code. If you flip to the other language tabs (in the below case Python) it'll be:

 

authentication_url = "https://api.box.com/oauth2/token";

 

We'll take a look over the page content and code and make adjustments to the docs to clear that up for Node.

 

Thanks,

Jon

Highlighted
Box Employee

Re: OATUH 2.0 Without SDK - Authentication URL

Hi @dhebert-dev,

 

To close the loop, the docs are now updated with the missing line (https://developer.box.com/guides/authentication/oauth2/without-sdk/#4-exchange-code). Thanks again for pointing this out.

 

- Jon