
MatthieuB.50680 (Customer) asked a question.
Hi there,
I'm struggling on configuring my Okta App credentials with my NuxtJS app.
I read this article from Andy March ( https://developer.okta.com/blog/2019/04/26/tutorial-build-universal-apps-with-nuxt ) but the Auth module has been updated since.
The documentation can be found here : https://auth.nuxtjs.org/
The module is alrealdy smoothly integrated with Autho but not Okta, for that we have to configure manually using Oauth2 schema.
So I followed the steps and define my nuxt.config.js like this for auth section (Flow with authorisation code) :
auth: {
redirect: {
login: 'https://dev-777111.okta.com',
logout: '/',
callback: '/auth/callback',
home: '/'
},
strategies: {
social: {
_scheme: 'oauth2',
authorization_endpoint: 'https://dev-777111.okta.com/oauth2/default/v1/',
userinfo_endpoint: https://dev-777111.okta.com/oauth2/default/v1/userinfo',
scope: ['openid', 'profile', 'email'],
access_type: 'offline',
access_token_endpoint: https://dev-777111.okta.com/oauth2/default/v1/token' ,
response_type: 'code',
token_type: 'Bearer',
client_id: 'Put my CLIENT ID HERE',
token_key: 'access_token',
}
}
},
Regarding the configuration of my app, it is like this:
My app redirected me on okta login page when want to access a protected route but I never comeback to my front app after.
Do you know how I can configure it to have it working in a clean way?
Thanks a lot.

Hi Matthieu,
This is Dragos from Okta Support, based on the description provided, it might need some more troubleshooting on this. For that please send an email at Okta Developer Support (developers@okta.com) and one of our engineers will assist you on this matter.
Hi Dragos,
similar thing here I get redirected to Okta admin panel,
not back to the app page... Any help?
thx
Hi Adam,
did you get any help on this. I am also facing same issue. If you get any help please help me
Hi,
Just came across this while preparing an update on that post. I'm updating that guide for nuxt/auth at the moment but your config should look like the below:
auth:{
strategies:{
okta:{
scheme: 'oauth2',
endpoints: {
authorization: process.env.OAUTH_ISSUER+"/v1/authorize",
token: process.env.OAUTH_ISSUER+"/v1/token",
userInfo: process.env.OAUTH_ISSUER+"/v1/userinfo",
logout: process.env.OAUTH_ISSUER+"/v1/logout"
},
token: {
property: 'access_token',
type: 'Bearer',
maxAge: 1800
},
responseType: 'code',
grantType: 'authorization_code',
clientId: process.env.CLIENT_ID,
scope: ['openid', 'profile', 'email'],
codeChallengeMethod: 'S256',
}
},
redirect: {
login: '/login',
callback: '/auth',
home: '/'
},
},
This does require the app to be configured as a SPA with PKCE in Okta rather than a standard web client with the authorization code grant.