Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I can't parse callback URL from OAuth2

ANSWERED

Hi

I am making a test program (will be open source :  java springframework ) that can read from a person's activity log's steps, calories, distance, and stairs. What I need to do is allow the user to copy their authorization token and user ID into the command-line interface.

 

The problem is that the URL doesn't use ?access_token...

but rather #access_token... in it.

The callback URL will take the user to a page on my website that can parse the URL and pull out what the end-user would use and is totally secure. The parser requires it to be as the first example but the second one is for HTML anchors and won't get picked up.

It can't modify it very easily. Is this a bug? Or is there a workaround?

Best Answer
0 Votes
2 BEST ANSWERS

Accepted Solutions

 

alert(window.location.hash);

 

 

 

 

http://stackoverflow.com/questions/13503213/how-to-get-the-url-fragment-identifier-from-httpservletr...

 

java - How to get the URL fragment identifier from HttpServletRequest - Stack Overflow

However, you can send the fragment string as a GET/POST parameter on a JavaScript request. To get the value using JavaScript, use window.location.hash. You can then pass this value as a GET or POST parameter in an AJAX request, and use the getParameter methods on the HttpServletRequest for the AJAX request.

View best answer in original post

Best Answer
0 Votes

The Implicit Grant Flow uses URL fragments (#).

 

The Authorization Code Grant Flow uses URL parameters (?).

 

This is intentional and to the OAuth 2.0 specification.

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

 

alert(window.location.hash);

 

 

 

 

http://stackoverflow.com/questions/13503213/how-to-get-the-url-fragment-identifier-from-httpservletr...

 

java - How to get the URL fragment identifier from HttpServletRequest - Stack Overflow

However, you can send the fragment string as a GET/POST parameter on a JavaScript request. To get the value using JavaScript, use window.location.hash. You can then pass this value as a GET or POST parameter in an AJAX request, and use the getParameter methods on the HttpServletRequest for the AJAX request.

Best Answer
0 Votes

The Implicit Grant Flow uses URL fragments (#).

 

The Authorization Code Grant Flow uses URL parameters (?).

 

This is intentional and to the OAuth 2.0 specification.

Best Answer
0 Votes

Thank you very mush.

have a good time.

Best Answer
0 Votes