Comments (2)
import { boot } from 'quasar/wrappers'
import VueKeyCloak from '@dsb-norge/vue-keycloak-js'
import axios from 'axios'
export default boot(async ({ app }) => {
async function tokenInterceptor () {
axios.interceptors.request.use(config => {
config.headers.Authorization = `Bearer ${app.config.globalProperties.$keycloak.token}`
return config
}, error => {
return Promise.reject(error)
})
}
return new Promise(resolve => {
app.use(VueKeyCloak, {
init: {
onLoad: 'check-sso',
flow: 'standard',
pkceMethod: 'S256',
silentCheckSsoRedirectUri: window.location.origin + '/silent-check-sso.html',
checkLoginIframe: false,
scope: 'openid email profile roles',
},
config: {
url: process.env.KEYCLOAK_URL,
realm: process.env.KEYCLOAK_REALM,
clientId: process.env.KEYCLOAK_CLIENTID
},
onInitError: (error, err) => {
console.error(error, err)
},
onReady: () => {
tokenInterceptor()
resolve()
}
})
})
})
The error is "login_required"
This is in the dev console
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'attribution-reporting'.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'run-ad-auction'.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'join-ad-interest-group'.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'browsing-topics'.
client-entry.js:49 [Quasar] Running PWA.
recipes#iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&error=login_required&state=59e73fa7-c9e8-45e4-847f-3fe410d2e913&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&state=30a14fdd-bd3b-4145-80c9-2cd567f60076&session_state=2789dff3-185a-4d11-aa5a-e6bd48ecf108&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&code=ed682ebf-682b-4bb3-8ecd-09964ea13344.2789dff3-185a-4d11-aa5a-e6bd48ecf108.70b39f4c-395f-491c-bda7-f1c4e4651e62:1 Third-party cookie will be blocked. Learn more in the Issues tab.
recipes#iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&error=login_required&state=59e73fa7-c9e8-45e4-847f-3fe410d2e913&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&state=30a14fdd-bd3b-4145-80c9-2cd567f60076&session_state=2789dff3-185a-4d11-aa5a-e6bd48ecf108&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&code=ed682ebf-682b-4bb3-8ecd-09964ea13344.2789dff3-185a-4d11-aa5a-e6bd48ecf108.70b39f4c-395f-491c-bda7-f1c4e4651e62:1 Third-party cookie will be blocked. Learn more in the Issues tab.
recipes#iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&error=login_required&state=59e73fa7-c9e8-45e4-847f-3fe410d2e913&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&state=30a14fdd-bd3b-4145-80c9-2cd567f60076&session_state=2789dff3-185a-4d11-aa5a-e6bd48ecf108&iss=https%3A%2F%2Fconnect.icod.de%2Fauth%2Frealms%2Fcooksbooks&code=ed682ebf-682b-4bb3-8ecd-09964ea13344.2789dff3-185a-4d11-aa5a-e6bd48ecf108.70b39f4c-395f-491c-bda7-f1c4e4651e62:1 Third-party cookie will be blocked. Learn more in the Issues tab.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'attribution-reporting'.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'run-ad-auction'.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'join-ad-interest-group'.
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'browsing-topics'.
connect.icod.de/auth/realms/cooksbooks/protocol/openid-connect/3p-cookies/step1.html:39 requestStorageAccess: May not be used in an insecure context.
hasStorageAccess @ connect.icod.de/auth/realms/cooksbooks/protocol/openid-connect/3p-cookies/step1.html:39
await in hasStorageAccess (async)
checkStorageAccess @ connect.icod.de/auth/realms/cooksbooks/protocol/openid-connect/3p-cookies/step1.html:12
(anonymous) @ connect.icod.de/auth/realms/cooksbooks/protocol/openid-connect/3p-cookies/step1.html:8
keycloak.js:31 Error: Failure during initialization of keycloak-js adapter
at @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2194:19 {error: 'login_required', error_description: undefined}error: "login_required"error_description: undefined[[Prototype]]: Objectconstructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()__defineGetter__: ƒ __defineGetter__()__defineSetter__: ƒ __defineSetter__()__lookupGetter__: ƒ __lookupGetter__()__lookupSetter__: ƒ __lookupSetter__()__proto__: (...)get __proto__: ƒ __proto__()set __proto__: ƒ __proto__()
onInitError @ keycloak.js:31
(anonymous) @ @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2195
Promise.catch (async)
init @ @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2192
(anonymous) @ @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2097
Promise.then (async)
(anonymous) @ @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2096
fulfilled @ @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2061
Promise.then (async)
step @ @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2074
(anonymous) @ @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2076
__awaiter @ @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2058
install @ @dsb-norge_vue-keycloak-js.js?v=1d1799c6:2084
use @ chunk-6YZ7MJAX.js?v=1d1799c6:5301
(anonymous) @ keycloak.js:16
(anonymous) @ keycloak.js:15
start @ client-entry.js:92
await in start (async)
(anonymous) @ client-entry.js:163
Promise.then (async)
(anonymous) @ client-entry.js:161
Promise.then (async)
(anonymous) @ client-entry.js:137
from vue-keycloak-js.
Im running the same version of Chrome, but we are running redhat-sso and therefor an older version of keycloak (also using 2.3.0 of vue-keycloak-js - not latest - because of keycloak-js version). And im not experiencing the issue you have.
https://developers.google.com/privacy-sandbox/3pcd/related-website-sets-integration
You sure your permission haven't been denied somehow?
The file it's referencing the error from is a file located on your keycloak server/application https://github.com/keycloak/keycloak/blob/main/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/3p-cookies-step1.html
from vue-keycloak-js.
Related Issues (20)
- For my keycloak version (18), the url configuration should not have "/auth" in the vite_vue3 example HOT 1
- $keycloak with vue 3 and vue-router 4 HOT 5
- Vue3 HOT 1
- Configurable token update interval
- The Vue 3 injection Symbol should be in a separate file and exported HOT 7
- Implementing PKCE with vue-keycloak-js HOT 2
- Always Redirect with URL #error=login_required HOT 3
- [vite] Internal server error: Failed to resolve import "@dsb-norge/vue-keycloak-js/dist/types" from "src/main.ts". Does the file exist? HOT 2
- [question] Where can I get an indication that the token has expired as a basis for jumping to the login
- Vue3 Support
- Support for Keycloak v21 HOT 1
- Cannot use namespace 'Keycloak' as a type HOT 2
- [question] Why and how do I prevent a blank page when the Keycloak server is not available? Vue, Keycloak, Quasar
- Refresh the system page and automatically add a hash parameter after the URL. How to remove the following parameters
- js-sha256 warning
- vue3 enable to use HRM HOT 1
- Vue Keycloak variable is undefined.
- Issuer displayed in browser URL after login? HOT 3
- Login success but redirect again. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-keycloak-js.