Suraj Chandgude
Suraj Chandgude

Reputation: 331

How to implement OIDC using vuex-oidc in vue.js

OIDC config Object: VUE_APP_OIDC_CONFIG={"authority": "https://auth.mainPlatform.com", "clientId": "<client-id>", "redirectUri": "http://localhost:8080/oidc-callback", "popupRedirectUri": "http://localhost:8080/oidc-popup-callback", "responseType": "id_token token", "scope": "openid email", "automaticSilentRenew": true, "automaticSilentSignin": true, "silentRedirectUri": "http://localhost:8080/silent-renew-oidc.html"}

Error: {context: "authenticateOidcSilent", error: "login_required"} App.vue?234e:38 I am listening to the oidc error event in vuex-oidc context: "authenticateOidcSilent" error: "login_required"

OpenId Connect Error

Upvotes: 1

Views: 2470

Answers (1)

Gary Archer
Gary Archer

Reputation: 29243

That's an absolutely standard part of the silent renewal flow and can happen for 2 reasons:

  • When the Authorization Server Session Cookie expires
  • If a browser drops the AS session cookie - eg Safari is likely to do this in 2020

The usual action when you get a login_required error code is to redirect the user to sign in again.

TROUBLESHOOTING

If this is happening on every token renewal request, I would debug via a tool such as Fiddler to see if the cookie is being sent. Your problem might be caused by recent browser restrictions on cross domain cookies.

For something to compare against, see my Silent Token Renewal blog post.

Upvotes: 1

Related Questions