TNG / keycloak-mock

A Java library to test REST endpoints secured by Keycloak via OpenID connect.
Apache License 2.0
120 stars 27 forks source link

Feature/desktop login #86

Closed ostrya closed 3 years ago

ostrya commented 3 years ago

This PR adds support for desktop client login (see https://www.keycloak.org/docs/latest/securing_apps/#_installed_adapter) using browser flow (the app opens a browser with the login dialog of the mock and opens a webserver that listens to the localhost redirect URL) and manual flow (the user is presented with a link to the login page with special redirect URI "urn:ietf:wg:oauth:2.0:oob", then gets redirected to a page containing the authorization code which manually needs to be entered in the application).

The custom "command line" flow of Keycloak (the client sets a display_mode parameter and gets a 401 response with a specification of the necessary input fields to present and a callback URL to which to send this input via form POST) is not implemented yet as it is deemed too much effort for now (see https://github.com/keycloak/keycloak/blob/master/server-spi-private/src/main/java/org/keycloak/authentication/ConsoleDisplayMode.java).

sonarcloud[bot] commented 3 years ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

49.1% 49.1% Coverage
0.0% 0.0% Duplication