Skip to content

AuthorizationManager.handleErrorResponse gives an INVALID_STATE error when called from an iFrame  #588

@max-l

Description

@max-l

In a browser single page app, I can solve the case where a "transfer.fileOperations.ls" request fails for lack of permission with the method : AuthorizationManager.handleErrorResponse

It works without problems.

I would like to get this to work with an iFrame, so that the web app doesn't get redirected, and instead open an iFrame, which calls the AuthorizationManager.handleErrorResponse.

Here is what I have tried:

  1. Main window logs in, calls "ls", gets the error

  2. iFrame is opened, it received the error object from the main window:

{    "authorization_parameters": {        "required_scopes": [
            "urn:globus:auth:scope:transfer.api.globus.org:all[*https://auth.globus.org/scopes/29f94847-8c7b-4c7b-b102-b3f3d5351e83/data_access]"        ],        "session_message": "Missing required data_access consent"    }

  1. code inside the iFrame calls AuthorizationManager.handleErrorResponse with the error object.

The authorazation page loads correctly inside the iFrame, when I click on "allow",

I get the following error:
Error code: INVALID_STATE

Invalid state parameter: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdGF0ZV9pZCI6MzA2MTU4NTMsImV4cCI6MTc1MzEzNjMwM30.OsiLop1ArKwDR0qznX4sHNOXnqwCax2EGsHdUJ4pH-k'

This iFrame approach differs from the standard method, in that there are 2 browser windows (main window and iFrame), each with it's own AutherazationManager.

The error object is recieved by the first (auth manager), passed to the second one (in the iFrame)

Is there a way to make this work ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions