-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[authentication-keycloak] Use reactivity-API internally (#62)
- Loading branch information
Showing
13 changed files
with
124 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@open-pioneer/authentication-keycloak": minor | ||
--- | ||
|
||
Update Keycloak JavaScript adapter to v25. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@open-pioneer/authentication-keycloak": patch | ||
--- | ||
|
||
Refactor: use reactivity API internally to maintain the current state. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# keycloak-sample | ||
|
||
Testing keycloak locally with docker. | ||
|
||
## Docker container | ||
|
||
Create a local docker container, for example by using the following command: | ||
|
||
```bash | ||
# Note: --rm will automatically delete your container when it exits | ||
$ docker run --rm -it -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:latest start-dev | ||
``` | ||
|
||
## Creating a client application | ||
|
||
Open <http://localhost:8080> and log in with `admin` / `admin`. | ||
|
||
Visit the "Clients" section of the admin console and click "Create client": | ||
|
||
![New Client](./testing/New_Client_1.png) | ||
|
||
Authentication can be left to default settings: | ||
|
||
![Client Settings](./testing/New_Client_2.png) | ||
|
||
Configure the URLs of your local application. | ||
We're using the path to the keycloak sample app in the following example. | ||
|
||
Note that the Vite server must run on the exact port used here (you can change the vite config to force a specific port, if necessary). | ||
|
||
![Client URLs](./testing/New_Client_3.png) | ||
|
||
Finally, save the new client configuration. | ||
|
||
## Configuring the sample app | ||
|
||
Create a file called `.env.local` in the root of this repository with the following content: | ||
|
||
``` | ||
VITE_KEYCLOAK_CONFIG_URL=http://localhost:8080 | ||
VITE_KEYCLOAK_CONFIG_REALM=master | ||
VITE_KEYCLOAK_CONFIG_CLIENT_ID=trails | ||
``` | ||
|
||
Afterwards, restart vite and open the keycloak sample app in your browser. | ||
It should now redirect you to your local keycloak and back to the sample app once you are authenticated. | ||
|
||
![Authenticated](./testing/Authenticated.png) | ||
|
||
Clicking the "Logout" button should end the session. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.