You’re right — the fragment identifier (everything after #) is never sent to the server. It’s only accessible on the client-side (browser), so you won’t be able to access it in Mendix through a regular microflow, REST call, or server-side request.
To retrieve the access token from a URL like this:
https://myapp.com/cognito/callback#access_token=abc
You’ll need to use JavaScript in a client-side Nanoflow or page script to extract the token from the URL. Here’s what you can do:
const hash = window.location.hash;
const params = new URLSearchParams(hash.slice(1));
const accessToken = params.get("access_token");
return accessToken;
4. Then pass this token back to the Nanoflow and store it in a variable or entity.
Alternatively, if you’re using AWS Cognito, consider using response_type=code instead of token in your auth flow, so the access code is sent via query parameters (after ?), which is accessible on the server-side.