cancel
Showing results for 
Search instead for 
Did you mean: 

InvalidGrantError: (invalid_grant) Redirect URI mismatch.

preemo
Explorer

I get this error on token endpoint at xsuaa/auth/token URL

The authorization code exchange works but the token does not. I use the same redirection url in both requests but it still fails ...

I have several entries in xs-security with wildcards but it doesn't seem it's working

What am i trying to do:

I am trying to append a query parameter, like so...

redirect_url = my_app.cfapps.hana.com/auth/callback/?fr=frontend_url/dashboard

it works if i just use this (domain/auth/callback) but not with query params ... why is that ?

xs-security:

"http://localhost/**",

"https://my-app.cfapps.eu10-004.hana.ondemand.com/**",

"https://*.hana.ondemand.com/**"
hello_sap_545454
Discoverer
0 Kudos

I 2nd this motion.

Accepted Solutions (0)

Answers (4)

Answers (4)

preemo
Explorer
0 Kudos

Ah I figured it out ... the redirect uris weren't quite the same in both requests .. i had a trailing slash in the first one, but not the 2nd one ...

works now...

thanks, and apologies

preemo
Explorer
0 Kudos

The URL is correct, that is just simplification.

CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

as of the docu, your wildcards seem to be OK, but I've never tried similar config.
Did you try with hard-coded full path instead of wildcards?
I've just noticed some difference in your snippets, but that might be just typo:

my-app <=> my_app
and
"https://*.hana.ondemand.com/**" <=> redirect_url = my_app.cfapps.hana.com/

My apologies, I have no better idea

Kind Regards,
Carlos

preemo
Explorer
0 Kudos

Pinging some of the known experts carlos.roggan jeffrey.groneberg arjun.t

sorry for barging in like that ...