Comments (7)
FYI, demo for integration with Capacitor
was already made here : #537.
(more specifically, this comment)
from oidc-client-ts.
@Badisi thank you for the fast replay. But i dont like its again another wrapper tbh. But it seems that there is currently no solution to achive that without a wrapper right? i appreciate your work - does your solution work with exactly my prerequisites? And how do i implement it?
from oidc-client-ts.
"Crypto.subtle is available only in secure contexts (HTTPS)." This error makes it impossible to test oidc in by using local ips in a private network (without setting up certificates and more).
from oidc-client-ts.
I was not intended to make you use my wrapper, but rather direct you towards a concrete example.
So that it can save you time to develop your Capacitor
side 😉
But if you do choose to use my wrapper, please let me know and I will be happy to help
from oidc-client-ts.
I try two different approaches
-
Continue with only oidc-client.ts but the usermanager didnt recieve the token from App.Listener(url) everything works okay but some different error happens
-
Starting with your lib - i installed it already and try to see how to implement it in my code. But without documentation its very hard to implement it in my vue3 application :)
from oidc-client-ts.
I already created a hybrid app by using angular. I used this lib https://github.com/manfredsteyer/angular-oauth2-oidc and it works perfectly - but it seems this lib and vue seems to work different...
from oidc-client-ts.
import { boot } from 'quasar/wrappers';
import { useAuthStore } from 'stores/auth.store';
import { App, URLOpenListenerEvent } from '@capacitor/app';
export default boot (({app, router}) => {
async function initializeOidcAfterRouting() {
console.log("OIDC client initialized")
try {
await authStore.initOidcClient(true);
} catch (error) {
console.error('Failed to initialize OIDC client:', error);
// Handle error (e.g., redirect to an error page)
}
}
App.addListener('appUrlOpen', function (event: URLOpenListenerEvent) {
// Example url: https://beerswift.app/tabs/tabs2
// slug = /tabs/tabs2
const slug = event.url.split('myapp://login').pop();
// We only push to the route if there is a slug present
if (slug) {
router.push(slug).then(() => {
initializeOidcAfterRouting();
});
}
});
const authStore = useAuthStore();
function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms))
}
router.beforeEach(async (to, from, next) => {
// wait till oidc is initiated
while (authStore.getUser === undefined) {
await sleep(100)
}
// clear url from keycloak state
if (authStore.isAuthenticated && to.fullPath.includes('/login')) {
next('/')
}
console.log(authStore.isAuthenticated)
if (to.matched.some(record => record.meta?.requiresAuth)) {
if (authStore.isAuthenticated) {
next()
} else {
next('/home')
}
} else {
next()
}
})
})
I think the only thing i need from now is, to get the token from keycloak to the usermanager. Everything works but on redirect the usermanager cant retrieve the token. This App uses history mode but however the url from android deeplink is converted to localhodst:5200/#/login?state...
It seems the usermanager cant work with the hash and i dont know how to solve it
from oidc-client-ts.
Related Issues (20)
- Feature request for OAuth2.1 client authentication methods HOT 8
- How to mock in playwright HOT 1
- [question] Frequent token refreshes HOT 4
- Crypto.subtle is available only in secure contexts (HTTPS) HOT 4
- Customize pop up window closed error?
- OAuth2 request_type="code" scope="openid ..." is spuriously validating id_token HOT 2
- Error: No matching state found in storage HOT 3
- user.querySessionStatus is never populated HOT 1
- Localstorage does not update when signinRedirect is called HOT 1
- Access token not renewed if expired HOT 8
- redirect_uri: Issue with IDCS HOT 2
- No state in response for one specific user HOT 1
- Issue with Refresh Token Rotation in oidc-client-ts: Concurrent Execution Problem in signinSilent() HOT 1
- Behaviour of addAccessTokenExpiring callback changed between 2.4.0 and 3.0.1 HOT 3
- Canceling a Popup From the Parent
- Babel - unknown Statement of type "ForOfStatement" HOT 2
- InvalidTokenError: Invalid token specified: missing part #2 HOT 4
- Single use Refresh Token over multiple Tabs HOT 1
- Revoke endpoint content type is not handled properly HOT 1
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 oidc-client-ts.