How to get the "fragment" part of an url in a nuxt middleware?

953 Views Asked by At

I want to get the access_token in the url after a redirection from AWS COGNITO in a "implicit" oauth flow. AWS Cognito redirect the browser to : https://mydomain/#access_token=xxxxx

I want to get the "access_token=xxxxx" part for storage, in a nuxt "middleware".

It doesn't seam to be in the "context.req" object. Where can I find it ?

1

There are 1 best solutions below

4
On

The Implicit flow doesn't return an authorization code like the Authorization flow does. You'll get the access token directly in the response body.

Here is a link with more info.

Implicit Flow