2023-02-20 12:58:57 +00:00
|
|
|
== Secure the first application
|
2023-02-09 09:29:41 +00:00
|
|
|
|
2023-02-20 12:58:57 +00:00
|
|
|
To secure the first application, you start by registering the application with your Keycloak instance:
|
2023-02-09 09:29:41 +00:00
|
|
|
|
2023-02-20 12:58:57 +00:00
|
|
|
. Open the {links-admin-console}.
|
|
|
|
. Click *Clients*.
|
|
|
|
. Click *Create client*
|
2023-02-09 09:29:41 +00:00
|
|
|
. Fill in the form with the following values:
|
2023-02-20 12:58:57 +00:00
|
|
|
** *Client type*: `OpenID Connect`
|
|
|
|
** *Client ID*: `myclient`
|
|
|
|
. Click *Next*
|
|
|
|
. Confirm that *Standard flow* is enabled.
|
|
|
|
. Click *Save*.
|
2023-02-09 09:29:41 +00:00
|
|
|
|
|
|
|
image::add-client-1.png[Add Client]
|
|
|
|
|
2023-02-20 12:58:57 +00:00
|
|
|
After the client is created, make these updates to the client:
|
2023-02-09 09:29:41 +00:00
|
|
|
|
2023-02-20 12:58:57 +00:00
|
|
|
. Scroll down to *Access settings*.
|
|
|
|
* Set *Valid redirect URIs* to `+https://www.keycloak.org/app/*+`
|
|
|
|
* Set *Web origins* to `+https://www.keycloak.org+`
|
|
|
|
. Click *Save*.
|
2023-02-09 09:29:41 +00:00
|
|
|
|
|
|
|
image::add-client-2.png[Update Client]
|
|
|
|
|
2023-02-20 12:58:57 +00:00
|
|
|
To confirm the client was created successfully, you can use the SPA testing application on the https://www.keycloak.org/app/[Keycloak website].
|
2023-02-09 09:29:41 +00:00
|
|
|
|
|
|
|
ifeval::[{links-local}==true]
|
2023-02-20 12:58:57 +00:00
|
|
|
. Open https://www.keycloak.org/app/.
|
|
|
|
. Click *Save* to use the default configuration.
|
2023-02-09 09:29:41 +00:00
|
|
|
endif::[]
|
|
|
|
|
|
|
|
ifeval::[{links-local}!=true]
|
2023-02-20 12:58:57 +00:00
|
|
|
. Open https://www.keycloak.org/app/.
|
|
|
|
. Change `Keycloak URL` to the URL of your Keycloak instance.
|
|
|
|
. Click *Save*.
|
2023-02-09 09:29:41 +00:00
|
|
|
endif::[]
|
|
|
|
|
2023-02-20 12:58:57 +00:00
|
|
|
. Click *Sign in* to authenticate to this application using the Keycloak server you started earlier.
|