@Deprecated public class HttpOAuthHelper extends AuthenticatorHelper
{ @code List<AuthenticatorHelper> authenticators = Engine.getInstance() .getRegisteredAuthenticators(); authenticators.add(new OAuthAuthenticationHelper()); }Here is the list of supported parameters. They should be set before starting an OAuth2 server or client:
Parameter name | Value type | Default value | Description |
---|---|---|---|
authPage | String | /auth_page | Specifies the path of the resource an AuthorizationServerResource should redirect authorization requests
for user interaction. This resource will be accessed using internal protocol Protocol.RIAP (i.e.
riap://application/authPage) |
authPageTemplate | String | null | Specifies the name of the authorization page. The name is used by AuthPageServerResource.getPage(String)
method in order to generate the HTML representation of the authorization page. If no scope is provided, the scope
"Roles" will be automatically granted. |
authSkipApproved | boolean | false | If true no authorization page will be shown if the Roles (scopes) have been previously approved by the user |
errorPageTemplate | String | null | Specifies the name of the error page. The name is used by
AuthorizationBaseServerResource.getErrorPage(String, OAuthException) method in order to generate the HTML
representation of the error page. If no scope is provided, the scope "Roles" will be automatically granted. |
loginPage | String | /login | Specifing a login resource location relative to the Application root. This resource will be accessed using
internal protocol Protocol.RIAP (i.e. riap://application/login) |
Constructor and Description |
---|
HttpOAuthHelper()
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
formatRequest(ChallengeWriter cw,
ChallengeRequest challenge,
Response response,
Series<Header> httpHeaders)
Deprecated.
|
static java.lang.String |
getAuthPage(Context context)
Deprecated.
Returns the value of the "authPage" parameter.
|
static java.lang.String |
getAuthPageTemplate(Context context)
Deprecated.
Returns the value of the "authPageTemplate" parameter.
|
static boolean |
getAuthSkipApproved(Context context)
Deprecated.
Returns the value of the "authSkipApproved" parameter.
|
static java.lang.String |
getErrorPageTemplate(Context context)
Deprecated.
Returns the value of the "errorPageTemplate" parameter.
|
static java.lang.String |
getLoginPage(Context context)
Deprecated.
Returns the value of the "loginPage" parameter.
|
void |
parseRequest(ChallengeRequest challenge,
Response response,
Series<Header> httpHeaders)
Deprecated.
|
static void |
setAuthPage(java.lang.String authPage,
Context context)
Deprecated.
Sets the value of the "authPage" parameter.
|
static void |
setAuthPageTemplate(java.lang.String authPageTemplate,
Context context)
Deprecated.
Sets the value of the "authPageTemplate" parameter.
|
static void |
setAuthSkipApproved(boolean skip,
Context context)
Deprecated.
Sets the value of the "authSkipApproved" parameter.
|
static void |
setErrorPageTemplate(java.lang.String errorPageTemplate,
Context context)
Deprecated.
Sets the value of the "errorPageTemplate" parameter.
|
static void |
setLoginPage(java.lang.String loginPage,
Context context)
Deprecated.
Sets the value of the "loginPage" parameter.
|
formatResponse, getChallengeScheme, getLogger, isClientSide, isServerSide, parseResponse, setChallengeScheme, setClientSide, setServerSide, updateReference
public HttpOAuthHelper()
ChallengeScheme.HTTP_OAUTH
authentication
scheme.public static java.lang.String getAuthPage(Context context)
context
- The context where to find the parameter.public static java.lang.String getAuthPageTemplate(Context context)
context
- The context where to find the parameter.public static boolean getAuthSkipApproved(Context context)
context
- The context where to find the parameter.public static java.lang.String getErrorPageTemplate(Context context)
context
- The context where to find the parameter.public static java.lang.String getLoginPage(Context context)
context
- The context where to find the parameter.public static void setAuthPage(java.lang.String authPage, Context context)
authPage
- The value of the "authPage" parameter.context
- The context to update.public static void setAuthPageTemplate(java.lang.String authPageTemplate, Context context)
authPageTemplate
- The value of the "authPageTemplate" parameter.context
- The context to update.public static void setAuthSkipApproved(boolean skip, Context context)
skip
- The value of the "authSkipApproved" parameter.context
- The context to update.public static void setErrorPageTemplate(java.lang.String errorPageTemplate, Context context)
errorPageTemplate
- context
- public static void setLoginPage(java.lang.String loginPage, Context context)
loginPage
- The value of the "loginPage" parameter.context
- The context to update.public void formatRequest(ChallengeWriter cw, ChallengeRequest challenge, Response response, Series<Header> httpHeaders) throws java.io.IOException
formatRequest
in class AuthenticatorHelper
java.io.IOException
public void parseRequest(ChallengeRequest challenge, Response response, Series<Header> httpHeaders)
parseRequest
in class AuthenticatorHelper
Copyright © 2005-2020 Restlet.