I'm a new comer for SSO. Recently I'm focusing on a project which is using OIDC. I try to use oidc-client to solve the problem. Here is my settings.(I erase the detail url, but they are effective).
var mgr = new Oidc.UserManager({
userStore: new Oidc.WebStorageStateStore({ store: window.localStorage }),
metadata: {
issuer: 'https://foo.com/',
authorization_endpoint: 'https://foo.com/',
userinfo_endpoint: 'https://foo.com/',
end_session_endpoint: 'https://foo.com/',
jwks_uri: 'https://foo.com/'
},
keys: [
{
'kty': 'RSA',
'kid': 'some info',
'use': 'some info',
'n': 'some info',
'e': 'some info'
}
],
client_id: 'aaaaa',
redirect_uri: 'https://foo.com/',
response_type: 'id_token token',
scope: 'openid'
})
Oidc.Log.logger = console
Oidc.Log.level = Oidc.Log.INFO
mgr.signinRedirect()
.then(function () { console.log('Hello') }).catch(function (err) {
console.log(err)
})
But it hasn't redirected to the authorization_endpoint. Instead, it raises an error like following
oidc-client.min.js?dd17:1 SigninRequest.ctor: No authority passed error @ oidc-client.min.js?dd17:1 SigninRequest @ oidc-client.min.js?dd17:3 (anonymous) @ oidc-client.min.js?dd17:3 Promise.then (async) createSigninRequest @ oidc-client.min.js?dd17:3 (anonymous) @ oidc-client.min.js?dd17:3 Promise.then (async) _signinStart @ oidc-client.min.js?dd17:3 signinRedirect @ oidc-client.min.js?dd17:3 onSubmit @ HelloWorld.vue?140d:71 click @ HelloWorld.vue?1f3f:21 invoker @ vue.runtime.esm.js?2b0e:2023 fn._withTask.fn._withTask @ vue.runtime.esm.js?2b0e:1822
I run the code under a vue-cli environment. But I don't think it will cause the problem. If you have met the similar problem, please tell me how to solve it. Thank you.
See required settings in https://github.com/IdentityModel/oidc-client-js/wiki
Required Settings
- authority (string): The URL of the OIDC/OAuth2 provider.
From the error and your code it looks like you are not setting authority