Skip to content

Refresh blocked by CORS policy: No 'Access-Control-Allow-Origin' header #98

@r300mrg

Description

@r300mrg

Using the latest code as of July 26th 2024 and configured to use Identity Provider (IdP) of Microsoft Entra ID (updating our dev server running legacy version of this code from a few years ago, not ideal but coming from a working setup at one point in time).

Initial site loads and authenticates as expected. However, after the authentication token expires the browser refresh fails to re-authenticate with the browser console providing the following CORS related issue:

Access to XMLHttpRequest at 'https://login.microsoftonline.com/<ENTRA_ID>/oauth2/authorize?response_type=code&scope=openid+profile+email+offline_access&client_id=<CLIENT_ID>_uri=https://:443/_codexch&nonce=aK5DJ3mdVwzXyqsXBzWKXvncXhvm4UJpcZQ0Lj2sbk&state=0' (redirected from 'https://<mysite/page1>') from origin 'https://' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I’ve attempted to add proxy_set_header Access-Control-Allow-Origin *; under both /_token and /_refresh in file openid_connect.server_conf, and this makes no difference.

Any thoughts or ideas how to resolve? Thanks

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