If you followed the instructions in the README
to run the app but noticed that the Player name is always Default-User
and there is no option to login, the following instructions will fix that.
Before we begin,
Please DO NOT use these instructions for a production environment. These are strictly for the purpose of development on a local machine ONLY.
- Make sure Docker is installed and is running.
- 1. Run Keycloak Container
- 2. Login to Keycloak
- 3. Create a new Client
- 3. Save Client Secret
- 4. Create New User
- 5. Logout of Admin on Keycloak
- 6. Start
waved
with authentication - 7. Start the App
- 8. Login to Wave app
$ docker run \
-p 8080:8080 \
-e KEYCLOAK_USER=admin \
-e KEYCLOAK_PASSWORD=admin \
quay.io/keycloak/keycloak:11.0.3
- Goto
http://localhost:8080
to connect to keycloak
- Click on
Administration Console
and login as User:admin
with Password:admin
- Click on
Clients
in the left menu
- Click
Create
button in the top right corner to create new client
- Enter a Client ID, for example:
wave
- Select Client Protocol to be
openid-connect
- Press
Save
- Right after the page is saved, new settings appear on the same page
- Set Access Type as
confidential
- Set Valid Redirect URIs as
*
- Press
Save
- Goto the
Credentials
tab for the newly created client - Save the Secret code to use later when starting the Wave Server.
- The code shown in this example is
76344ea2-f64d-43a1-b150-725e385b2fee
- Click on
Users
in the left menu underManage
- Click on
Add User
in the top right corner to add a new user
- Enter an email, for example
[email protected]
as Username - Press
Save
- After saving, goto the
Credentials
tab for the newly created user - Enter a new password for the user
- Set Temporary field to
OFF
- Press
Set Password
- Create as many users as needed in this way
- To see all the users, click on
Users
underManage
in the left menu - Click on
View all users
button
- After all required users are created, logout as
admin
and close the browser window so that we can login as one of the newly created users while using the Wave app.
- Find the previously saved
Client Secret
in Step 3 - In the next command, replace the value of
oidc-client-secret
with yourClient Secret
- Use the following command to start the Wave Server
./waved -oidc-client-id wave \
-oidc-client-secret 76344ea2-f64d-43a1-b150-725e385b2fee \
-oidc-end-session-url http://localhost:8080/auth/realms/master/protocol/openid-connect/logout \
-oidc-provider-url http://localhost:8080/auth/realms/master \
-oidc-redirect-url http://localhost:10101/_auth/callback
- Assuming that the python environment for the wave app is already setup, and make sure you are in the right directory and start the app using
$ wave run guess_the_number/guess.py
- In a new
incognito
browser window, gotohttp://localhost:10101
to launch the app - The app will require you to login now
- Login as one of the newly created users.
- Once logged in, we can see the Player's name displayed on top.
- Use a different browser, for example
chrome/firefox
to login simultaneously as a different user - Play a few games while logged in as each player
- Private games include games that are abandoned by selecting
Quit
and games that are not selected to be shared publicly