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.
07-22-2016 00:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-22-2016 00:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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?
Answered! Go to the Best Answer.
Accepted Solutions
07-27-2016 17:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-27-2016 17:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
alert(window.location.hash);
java - How to get the URL fragment identifier from HttpServletRequest - Stack Overflow

07-28-2016 22:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



07-28-2016 22:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.

07-27-2016 17:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-27-2016 17:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
alert(window.location.hash);
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. |

07-28-2016 22:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



07-28-2016 22:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.

07-28-2016 22:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-28-2016 22:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thank you very mush.
have a good time.

