NOTE: Is that preffered_username setting wrong? Correct settings should be for OIDC login:
```
sudo snap set wekan oauth2-username-map='email'
sudo snap set wekan oauth2-email-map='email'
```
[Outstanding Bug](https://github.com/wekan/wekan/issues/1874#issuecomment-460802250): Create the first user (admin) with the regular process. Then the remaining users can use the Register with OIDC process.
[Keycloak at Docker Hub](https://hub.docker.com/r/jboss/keycloak)
Environment Variables that need to be set in your Wekan environment:
> When creating a Client in keycloak, ensure the access type is confidential under the settings tab. After clicking save, you will have a Credentials tab. You can retrieve the secret from that location.
## Snap
Copy below commands to `auth.sh` textfile, make it executeable `chmod +x auth.sh` and run it with `./auth.sh`.
```
sudo snap set wekan oauth2-enabled='true'
sudo snap set wekan oauth2-client-id='<KeycloakcreateClientID>'
sudo snap set wekan oauth2-secret='<KeycloakClientsecret>'
sudo snap set wekan oauth2-server-url='<Keycloakservername>/auth'
sudo snap set wekan oauth2-auth-endpoint='/realms/<keycloakrealm>/protocol/openid-connect/auth'
sudo snap set wekan oauth2-userinfo-endpoint='/realms/<keycloakrealm>/protocol/openid-connect/userinfo'
sudo snap set wekan oauth2-token-endpoint='/realms/<keycloakrealm>/protocol/openid-connect/token'
sudo snap set wekan oauth2-id-map='preferred_username'
sudo snap set wekan oauth2-username-map='preferred_username'
sudo snap set wekan oauth2-fullname-map='given_name'