Skip to main content
Question

JWT enabled but still get redirect_uri_mismatch

  • May 21, 2025
  • 6 replies
  • 40 views

Forum|alt.badge.img

I have created an app and enabled JWT authenticaction. When I run the code for authorization I get back the error for redirect_uri_mismatch.

 

There is no field in the app for the redirect_uri when JWT authentication is enabled.

 

I see where to set the redirect_uri if I don't enable JWT authentication.

 

Any help would be appreciated.

6 replies

Forum|alt.badge.img

Are you using an SDK? If so, which one?

 

Can you paste the code that you're using which is failing?

 

Make sure you're using the methods for the JWT auth process, and not the OAuth2 process.


Forum|alt.badge.img

I am using the following sdk

https://github.com/golchha21/BoxPHPAPI

https://app.box.com/api/oauth2/authorize?response_type=code&client_id=1h1gbnexmm1i2ehth97c9lhmz4ukpgbk&redirect_uri=https%3A%2F%2Fdev.smm.events.nba.com%2Findex.php%3Foption%3Dcom_chronoforms%26chronoform%3Dbox_response

 

I thought I was but maybe not for the auth process. can you include the directions for that, please


Forum|alt.badge.img

In further review, I can see I am using OAuth. I changed my authentication type and included a redirect_uri and now I get prompted to grant access.

 

Is there a way to bypass the grant access prompt?

When I do grant access, box.com does provide back a code


Forum|alt.badge.img

If you are intending to have users log in with their Box accounts, then your app needs to be set up to do 3-leg OAuth2, not JWT.

 

If you are intending to use JWT to access a service account or app users, then you shouldn't be using the /authorize page.

 

Our documentation provider is currently experiencing an outage. But when it comes back up, you can find more information about how to do JWT auth at the following links:

 

https://docs.box.com/docs/authentication

https://docs.box.com/docs/configuring-box-platform

https://docs.box.com/docs/app-auth

https://docs.box.com/docs/app-users

 

Unfortunately, it looks like the unofficial SDK you are using has no support for JWT auth.


Forum|alt.badge.img

If you are intending to use 3-leg OAuth2, there is no way to bypass the grant process. That is a required part of allowing users to authenticate with your application.

 

Once you receive an auth_code back, you can use the /token endpoint to exchange it for an access token and refresh token.


Forum|alt.badge.img

Hello, 

 

I have using the Java SDK for the same. I got it from https://github.com/box/box-java-sdk. Using the JWT method for authentication but not able to find the feild for redirect uri in Box UI. when a response comes for 

url: 

https://account.box.com/api/oauth2/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&state=security_token%3DKnhMJatFipTAnM0nHlZA
 it says:  Error: redirect_uri_mismatch