Skip to content

Having trouble opening the browser authorization URL to retrieve authorization code #13

@wmLowry

Description

@wmLowry

I'm running this code in my server.js:

let authUrl = ebayAuthToken.generateUserAuthorizationUrl('PRODUCTION', scopes, options);
    authUrl = authUrl.split(" ")
    res.redirect(authUrl[0]);

But I keep getting this error in my console:

Access to XMLHttpRequest at 'https://auth.ebay.com/oauth2/authorize?client_id=---CLIENT-ID---&response_type=code&scope=https://auth.ebay.com/oauth2/authorize?client_id=---CLIENT-ID---&response_type=code&redirect_uri=---REDIRECT-URI---=https://api.ebay.com/oauth/api_scope' (redirected from 'https://localhost:3000/ebay-user-auth') from origin 'https://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I switched out my client IDs and the URI with placeholders. I am using Express js but not AJAX.

Any ideas on how to fix this error?

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