Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help with response_type #34

Open
purefan opened this issue Nov 6, 2019 · 0 comments
Open

Need help with response_type #34

purefan opened this issue Nov 6, 2019 · 0 comments

Comments

@purefan
Copy link

purefan commented Nov 6, 2019

Hello,

Im trying to get a quick oauth mock flow working and currently having issues with the response_type, here is the output of running oauth2-client-js:

Running on http://localhost:8282
        expected Client ID: dummy-client-id
        expected Client Secret: dummy-client-secret
        authorization endpoint: /auth/request/path
        access token endpoint: /access/token/request
        redirect URLs: http://mysite.test/#!/user/login/callback
GET /auth/request/path?response_type=token&scope=&client_id=dummy-client-id&redirect_uri=http%3A%2F%2Fmysite.test%2Fuser%2Flogin%2Fcallback&state=7acfebb1-c2d7-42ff-9cc3-925fa77d3a9b 401 Authorization: - Debug info: Error: expected response_type: "code" but actual: "token" Redirect: -

The website ends up of course in a 401. And this is how I'm building the redirect uri:

const provider = new OAuth.Provider({
    id: 'fake',  
    authorization_url: 'http://localhost:8282/auth/request/path'
});

const request = new OAuth.Request({
    client_id: 'dummy-client-id', 
    redirect_uri: 'http://mysite.test/user/login'
    , response_type: 'token'
})

const uri = provider.requestToken(request);
provider.remember(request);
window.location.href = uri;

Perhaps related to #28 but any clue on how to set this to code? or have the library accept token as its hardcoded in https://github.com/zalando-stups/oauth2-client-js/blob/master/src/request.js#L25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant