keycloak
|
クラス | |
class | HeaderBuilder |
公開メンバ関数 | |
LoginFormsProvider | form () |
Response | message (String msg, String... params) |
Response | text (String text) |
Response | response () |
HeaderBuilder | header () |
静的公開メンバ関数 | |
static Response | browserRequired (KeycloakSession session) |
static Response | browserContinue (KeycloakSession session, String callback) |
static ConsoleDisplayMode | challenge (RequiredActionContext context) |
static ConsoleDisplayMode | challenge (AuthenticationFlowContext context) |
static HeaderBuilder | header (RequiredActionContext context) |
static HeaderBuilder | header (AuthenticationFlowContext context) |
限定公開メンバ関数 | |
LoginFormsProvider | formInternal () |
限定公開変数類 | |
RequiredActionContext | requiredActionContext |
AuthenticationFlowContext | flowContext |
HeaderBuilder | header |
関数 | |
ConsoleDisplayMode (RequiredActionContext requiredActionContext) | |
ConsoleDisplayMode (AuthenticationFlowContext flowContext) | |
This class encapsulates a proprietary HTTP challenge protocol designed by keycloak team which is used by text-based console clients to dynamically render and prompt for information in a textual manner. The class is a builder which can build the challenge response (the header and response body).
When doing code to token flow in OAuth, server could respond with
401 WWW-Authenticate: X-Text-Form-Challenge callback="http://localhost/..." param="username" label="Username: " mask=false param="password" label="Password: " mask=true Content-Type: text/plain
Please login with your username and password
The client receives this challenge. It first outputs whatever the text body of the message contains. It will then prompt for username and password using the label values as prompt messages for each parameter.
After the input has been entered by the user, the client does a form POST to the callback url with the values of the input parameters entered.
The server can challenge with 401 as many times as it wants. The client will look for 302 responses. It will will follow all redirects unless the Location url has an OAuth "code" parameter. If there is a code parameter, then the client will stop and finish the OAuth flow to obtain a token. Any other response code other than 401 or 302 the client should abort with an error message.
|
inlinepackage |
|
inlinepackage |
|
inlinestatic |
Browser is required to continue login. This will prompt client on whether to continue with a browser or abort.
session | |
callback |
|
inlinestatic |
Browser is required to login. This will abort client from doing a console login.
session |
|
inlinestatic |
Build challenge response for required actions
context |
|
inlinestatic |
Build challenge response for authentication flows
context |
|
inline |
Create a theme form pre-populated with challenge
|
inlineprotected |
|
inlinestatic |
Build challenge response header only for required actions
context |
|
inlinestatic |
Build challenge response header only for authentication flows
context |
|
inline |
Start building the header
|
inline |
Create challenge response with a body generated from localized message.properties of your theme
msg | message id |
params | parameters to use to format the message |
|
inline |
Generate response with empty http response body
|
inline |
Create challenge response with a text message body
text | plain text of http response body |
|
protected |
|
protected |
|
protected |