- Notifications
You must be signed in to change notification settings - Fork 280
feat: add PKCE support to AuthorizationCodeFlow #470
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
Changes from all commits
61a616e
4bf2925
778797b
73fa760
b0f0a9f
8b5e316
3bb51aa
b582b87
7238b21
c5def75
b089e33
066cadc
7272beb
bdb43ac
f2efde6
1f0e9b8
d3e7b47
1ee31a0
0196cfa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Instructions for the Keycloak OAuth2 with PKCE Command-Line Sample | ||
| ||
## Browse Online | ||
| ||
[Browse Source][browse-source], or main file [PKCESample.java][main-source]. | ||
| ||
## Command-Line Instructions | ||
| ||
**Prerequisites:** install [Java 7 or higher][install-java], [git][install-git], and | ||
[Maven][install-maven]. You may need to set your `JAVA_HOME`. | ||
You'll also need [Docker][install-docker]. | ||
| ||
1. Check out the sample code: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what keycloak is, or if we can include this part in a google project There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh... that had not occurred to me. Keycloak is a JBoss (Red Hat) project, it's an "open source identity and access management solution" (https://www.keycloak.org/) and it's released under the Apache 2.0 license. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a license issue, but we would like the docs for this product to be self-contained. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gotcha. However, the daily motion example isn't exactly self-contained is is? It actually depends on the user registering an account with dailymotion.com. But if using keycloak is not acceptable, can you suggest an alternative or should I remove the sample completely? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @elharo any thoughts on this? | ||
| ||
```bash | ||
git clone https://github.com/google/google-oauth-java-client.git | ||
cd google-oauth-java-client | ||
``` | ||
| ||
2. Run keycloak in a docker container: | ||
| ||
``` | ||
docker run -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:10.0.1 | ||
``` | ||
| ||
3. Run the sample: | ||
| ||
```bash | ||
mvn install | ||
mvn exec:java -pl samples/keycloak-pkce-cmdline-sample | ||
``` | ||
| ||
This will open up the Keycloak login page where you can log in with the username/password specified | ||
when running the Keycloak docker container above (`admin / admin`). Once you log in, the application | ||
will print out a message that it successfully obtained an access token. | ||
| ||
[browse-source]: https://github.com/google/google-oauth-java-client/tree/dev/samples/keycloak-pkce-cmdline-sample | ||
[main-source]: https://github.com/google/google-oauth-java-client/blob/dev/samples/keycloak-pkce-cmdline-sample/src/main/java/com/google/api/services/samples/keycloak/cmdline/PKCESample.java | ||
[install-java]: https://java.com/ | ||
[install-git]: https://git-scm.com | ||
[install-maven]: https://maven.apache.org | ||
[install-docker]: https://docs.docker.com/get-docker/ |
Uh oh!
There was an error while loading. Please reload this page.