I am having invalid_request : Missing required parameter: client_id on a new Vue3 Auth0-vue.
Can anyone help where is the problem?
I am using auth0-vue 2.1.0 and Vue 3.2.47.
Configuration of Auth on a auth0.js file:
import { createAuth0 } from '@auth0/auth0-vue';
import router from './router'
export default createAuth0({
domain: "domain",
client_id: "clientid",
authorizationParams: {
redirect_uri: window.location.origin
},
onRedirectCallback: appState => {
router.push(
appState && appState.targetUrl
? appState.targetUrl
: window.location.pathname
);
},
cache: {
cacheLocation: 'localStorage', // This configures where your cache will be stored
storeAuthStateInCookie: true, // Set this to "true" if you are having issues on IE11 or Edge
secureCookies: false,
}
})
on main.js I have:
....
import router from './router'
import store from './store'
import auth0 from './auth0'
const app = createApp(App)
app.use(auth0).use(vuetify).use(router).use(store).mount('#app')
and on the component where I have the button to request the login:
...
login() {
alert('Login: ' + JSON.stringify(this.$auth0))
this.$auth0.loginWithRedirect({
appState: {
target: "/projects",
}
});
},
...
on the alert above the auth0 appears to be correct with:
{"clientOptions":{"domain":"domain,"client_id":"clientid","authorizationParams":{"redirect_uri":"http://localhost:1337"},"cache":{"cacheLocation":"localStorage","storeAuthStateInCookie":true,"secureCookies":false}},"_isLoading":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":true,"_value":true},"_isAuthenticated":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":false,"_value":false},"_user":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":{},"_value":{}},"_idTokenClaims":{"__v_isShallow":false,"__v_isRef":true},"_error":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":null,"_value":null},"isLoading":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":true,"_value":true},"isAuthenticated":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":false,"_value":false},"user":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":{},"_value":{}},"idTokenClaims":{"__v_isShallow":false,"__v_isRef":true},"error":{"__v_isShallow":false,"__v_isRef":true,"_rawValue":null,"_value":null},"_client":{"userCache":{},"defaultOptions":{"authorizationParams":{"scope":"openid profile email"},"useRefreshTokensFallback":false,"useFormData":true},"options":{"authorizationParams":{"scope":"openid profile email","redirect_uri":"http://localhost:1337"},"useRefreshTokensFallback":false,"useFormData":true,"domain":"domain","client_id":"clientid","cache":{"cacheLocation":"localStorage","storeAuthStateInCookie":true,"secureCookies":false},"auth0Client":{"name":"auth0-vue","version":"2.1.0"}},"httpTimeoutMs":10000,"cookieStorage":{},"orgHintCookieName":"auth0.undefined.organization_hint","isAuthenticatedCookieName":"auth0.undefined.is.authenticated","sessionCheckExpiryDays":1,"scope":"openid profile email","transactionManager":{"storage":{},"storageKey":"a0.spajs.txs.undefined","transaction":{"nonce":"UkxZVEFrRUpGVERncjNIVmtFOFVwQzFsZV9VZDR4WHpBbzJfUXAxNWdORA==","code_verifier":"a9PbGhGXl8UyxCQ0HdGgHaICjpdZz40xr9lY583aKTS","scope":"openid profile email","audience":"default","redirect_uri":"http://localhost:1337","state":"bXNYSnB1YjFNVy1NUEpJMXlLWkJhbU9QcHk3aVpUTTg0YlZuN0t1RGlVZA==","appState":{"target":"/projects"}}},"cacheManager":{"cache":{"cacheLocation":"localStorage","storeAuthStateInCookie":true,"secureCookies":false},"keyManifest":{"cache":{"cacheLocation":"localStorage","storeAuthStateInCookie":true,"secureCookies":false},"manifestKey":"@@auth0spajs@@::undefined"}},"domainUrl":"https://domain","tokenIssuer":"https://domain/"}}
Can anyone help me see where is the problem?
Best regards,