-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Keycloak SPA example #45728
Update Keycloak SPA example #45728
Conversation
🙈 The PR is closed and the preview is expired. |
This comment has been minimized.
This comment has been minimized.
docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc
Outdated
Show resolved
Hide resolved
@mabartos could someone from the Keycloak team review this? Also maybe @phillip-kruger for the JS part. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. You can also use :
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>keycloak-js</artifactId>
<version>26.1.0</version>
<scope>runtime</scope>
</dependency>
and then :
import Keycloak from "/_static/keycloak-js/26.1.0/lib/keycloak.js"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jedla97
@rolfedh Hi Rolfe, are you OK with this PR to me merged ? |
Sorry, @gsmet, you asked about the feedback from the Keycloak team... Let me CC @pedroigor too. |
Yes, I’m fine with this PR being merged. I’ve provided a suggestion and am hoping to see a response or update, but it’s not essential if the author prefers to proceed as is. |
13e25cc
to
e5b2cc1
Compare
e5b2cc1
to
101680c
Compare
I looked at this and seems like only few version is available https://mvnrepository.com/artifact/org.mvnpm/keycloak-js. So I didn't add any notes about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This comment has been minimized.
This comment has been minimized.
Hi @jedla97, I’m not entirely sure how the team usually handles this, but I was wondering if these changes might require a review or updates to the quarkus-quickstarts/security-keycloak-authorization-quickstart. Let me know if I can help with anything! |
Hi @rolfedh, This is only a basic scrip example (as far as I recall, provided by Pedro awhile back) explaining how users can create SPAs which can login users into Keycloak - at this point Quarkus is not even involved, and it is not related to Hi @jedla97 Did you try this updated SPA fragment ? If you did, given it must've been working for you, IMHO we can just merge, since this snippet is not meant to offer a production-quality SPA script code that users can copy and paste. May be it is worth updating the note to let users know that they should work with the Keycloak documentation to create a fully functioning SPA which integrates with Keycloak |
Status for workflow
|
Hi @sberyozkin
Yes I try it and it worked
In note I pointing to Keycloak docs Would you like it more like: |
Hi @jedla97 Great, I think an update like that would be perfect and then I believe we should merge, if someone from Keycloak team finds some time to suggest further edits then we can apply them easily |
847235f
to
f478c00
Compare
Changed the text refering to Keycloak docs, so now it should be fine |
This comment has been minimized.
This comment has been minimized.
Thanks @jedla97, I'll try ti finalize tomorrow, Guillaume, hope you are ok with us merging it soon |
@vmuzikar Could you please check it, or notify some people as I'm currently on PTO? Thank you very much! |
docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc
Outdated
Show resolved
Hide resolved
f478c00
to
ee47731
Compare
Thanks @jedla97. IMHO we are ready to merge, this is a basic script fragment, confirmed to be working, and with links to the Keycloak doc page providing all the details, so hope everyone is OK with us merging it shortly, CC @gsmet @mabartos @vmuzikar, and of course we will always welcome further feedback. Cheers. |
Status for workflow
|
Let me merge now |
Fixes #37845
The
.success
and.error
was removed in KC 22 (https://www.keycloak.org/docs/latest/upgrading/#legacy-promise-api-removed-from-keycloak-js-adapter)With KC 26 the js libs are no longer available on server (https://www.keycloak.org/docs/latest/upgrading/#keycloak-js), Also they now expected the script in modules.
I play with it and can say it can't be backported to 3.15 as it is so I would start with this from 3.19 or possibly backport it to 3.18 as it's contain KC 26.
Note that I not expert in js so there can be more nicer code how to do this
cc @rolfedh as you make some workaround regarding this for RHBQ docs