OAuth2Provider
OAuth2Provider supports issue access token and authorize.
=== Create controller for issue access token ===
Attributes
- Example
-
object OAuth2Controller extends Controller with OAuth2Provider { def accessToken = Action.async { implicit request => issueAccessToken(new MyDataHandler()) } }
=== Register routes ===
POST /oauth2/access_token controllers.OAuth2Controller.accessToken
=== Authorized ===
import scalaoauth2.provider._ object BookController extends Controller with OAuth2Provider { def list = Action.async { implicit request => authorize(new MyDataHandler()) { authInfo => val user = authInfo.user // User is defined on your system // access resource for the user } } }
- Graph
-
- Supertypes
- Known subtypes
-
class AuthorizedActionFunction[U]
Members list
Type members
Inherited classlikes
Generates default Result
from a content type, headers and content.
Generates default Result
from a content type, headers and content.
Value parameters
- status
-
the HTTP response status, e.g ‘200 OK’
Attributes
- Inherited from:
- Results
- Supertypes
-
class Resulttrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Value members
Inherited methods
Generates a ‘302 FOUND’ simple result.
Generates a ‘302 FOUND’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a ‘301 MOVED_PERMANENTLY’ simple result.
Generates a ‘301 MOVED_PERMANENTLY’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a ‘308 PERMANENT_REDIRECT’ simple result.
Generates a ‘308 PERMANENT_REDIRECT’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a redirect simple result.
Generates a redirect simple result.
Value parameters
- call
-
Call defining the URL to redirect to, which typically comes from the reverse router
- status
-
HTTP status for redirect, such as SEE_OTHER, MOVED_TEMPORARILY or MOVED_PERMANENTLY
Attributes
- Inherited from:
- Results
Generates a redirect simple result.
Generates a redirect simple result.
Value parameters
- call
-
Call defining the URL to redirect to, which typically comes from the reverse router
Attributes
- Inherited from:
- Results
Generates a redirect simple result.
Generates a redirect simple result.
Value parameters
- queryStringParams
-
queryString parameters to add to the queryString
- status
-
HTTP status for redirect, such as SEE_OTHER, MOVED_TEMPORARILY or MOVED_PERMANENTLY
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a redirect simple result.
Generates a redirect simple result.
Value parameters
- statusCode
-
HTTP status
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a ‘303 SEE_OTHER’ simple result.
Generates a ‘303 SEE_OTHER’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a simple result.
Generates a simple result.
Value parameters
- code
-
the status code
Attributes
- Inherited from:
- Results
Generates a ‘307 TEMPORARY_REDIRECT’ simple result.
Generates a ‘307 TEMPORARY_REDIRECT’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Authorize to already created access token in ProtectedResourceHandler process and return the response to client.
Authorize to already created access token in ProtectedResourceHandler process and return the response to client.
Type parameters
- A
-
play.api.mvc.Request has type.
- U
-
set the type in AuthorizationHandler.
Value parameters
- callback
-
Callback is called when authentication is successful.
- ctx
-
This contxt is used by ProtectedResource.
- handler
-
Implemented ProtectedResourceHandler for authenticate to your system.
- request
-
Play Framework is provided HTTP request interface.
Attributes
- Returns
-
Authentication is successful then the response use your API result. Authentication is failed then return BadRequest or Unauthorized status to client with cause into the JSON.
- Inherited from:
- OAuth2ProtectedResourceProvider
Issue access token in AuthorizationHandler process and return the response to client.
Issue access token in AuthorizationHandler process and return the response to client.
Type parameters
- A
-
play.api.mvc.Request has type.
- U
-
set the type in AuthorizationHandler.
Value parameters
- ctx
-
This context is used by TokenEndPoint.
- handler
-
Implemented AuthorizationHandler for register access token to your system.
- request
-
Play Framework is provided HTTP request interface.
Attributes
- Returns
-
Request is successful then return JSON to client in OAuth 2.0 format. Request is failed then return BadRequest or Unauthorized status to client with cause into the JSON.
- Inherited from:
- OAuth2TokenEndpointProvider
Attributes
- Inherited from:
- OAuth2BaseProvider
Inherited fields
Generates a ‘202 ACCEPTED’ result.
Generates a ‘202 ACCEPTED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘502 BAD_GATEWAY’ result.
Generates a ‘502 BAD_GATEWAY’ result.
Attributes
- Inherited from:
- Results
Generates a ‘400 BAD_REQUEST’ result.
Generates a ‘400 BAD_REQUEST’ result.
Attributes
- Inherited from:
- Results
Generates a ‘409 CONFLICT’ result.
Generates a ‘409 CONFLICT’ result.
Attributes
- Inherited from:
- Results
Generates a ‘100 Continue’ result.
Generates a ‘100 Continue’ result.
Attributes
- Inherited from:
- Results
Generates a ‘201 CREATED’ result.
Generates a ‘201 CREATED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘413 REQUEST_ENTITY_TOO_LARGE’ result.
Generates a ‘413 REQUEST_ENTITY_TOO_LARGE’ result.
Attributes
- Inherited from:
- Results
Generates a ‘417 EXPECTATION_FAILED’ result.
Generates a ‘417 EXPECTATION_FAILED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘424 FAILED_DEPENDENCY’ result.
Generates a ‘424 FAILED_DEPENDENCY’ result.
Attributes
- Inherited from:
- Results
Generates a ‘403 FORBIDDEN’ result.
Generates a ‘403 FORBIDDEN’ result.
Attributes
- Inherited from:
- Results
Generates a ‘504 GATEWAY_TIMEOUT’ result.
Generates a ‘504 GATEWAY_TIMEOUT’ result.
Attributes
- Inherited from:
- Results
Generates a ‘410 GONE’ result.
Generates a ‘410 GONE’ result.
Attributes
- Inherited from:
- Results
Generates a ‘505 HTTP_VERSION_NOT_SUPPORTED’ result.
Generates a ‘505 HTTP_VERSION_NOT_SUPPORTED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘418 IM_A_TEAPOT’ result.
Generates a ‘418 IM_A_TEAPOT’ result.
Attributes
- Inherited from:
- Results
Generates a ‘507 INSUFFICIENT_STORAGE’ result.
Generates a ‘507 INSUFFICIENT_STORAGE’ result.
Attributes
- Inherited from:
- Results
Generates a ‘500 INTERNAL_SERVER_ERROR’ result.
Generates a ‘500 INTERNAL_SERVER_ERROR’ result.
Attributes
- Inherited from:
- Results
Generates a ‘423 LOCKED’ result.
Generates a ‘423 LOCKED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘405 METHOD_NOT_ALLOWED’ result.
Generates a ‘405 METHOD_NOT_ALLOWED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘207 MULTI_STATUS’ result.
Generates a ‘207 MULTI_STATUS’ result.
Attributes
- Inherited from:
- Results
Generates a ‘511 NETWORK_AUTHENTICATION_REQUIRED’ result.
Generates a ‘511 NETWORK_AUTHENTICATION_REQUIRED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘204 NO_CONTENT’ result.
Generates a ‘204 NO_CONTENT’ result.
Attributes
- Inherited from:
- Results
Generates a ‘203 NON_AUTHORITATIVE_INFORMATION’ result.
Generates a ‘203 NON_AUTHORITATIVE_INFORMATION’ result.
Attributes
- Inherited from:
- Results
Generates a ‘406 NOT_ACCEPTABLE’ result.
Generates a ‘406 NOT_ACCEPTABLE’ result.
Attributes
- Inherited from:
- Results
Generates a ‘404 NOT_FOUND’ result.
Generates a ‘404 NOT_FOUND’ result.
Attributes
- Inherited from:
- Results
Generates a ‘501 NOT_IMPLEMENTED’ result.
Generates a ‘501 NOT_IMPLEMENTED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘304 NOT_MODIFIED’ result.
Generates a ‘304 NOT_MODIFIED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘200 OK’ result.
Generates a ‘200 OK’ result.
Attributes
- Inherited from:
- Results
Generates a ‘206 PARTIAL_CONTENT’ result.
Generates a ‘206 PARTIAL_CONTENT’ result.
Attributes
- Inherited from:
- Results
Generates a ‘402 PAYMENT_REQUIRED’ result.
Generates a ‘402 PAYMENT_REQUIRED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘412 PRECONDITION_FAILED’ result.
Generates a ‘412 PRECONDITION_FAILED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘428 PRECONDITION_REQUIRED’ result.
Generates a ‘428 PRECONDITION_REQUIRED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘431 REQUEST_HEADER_FIELDS_TOO_LARGE’ result.
Generates a ‘431 REQUEST_HEADER_FIELDS_TOO_LARGE’ result.
Attributes
- Inherited from:
- Results
Generates a ‘408 REQUEST_TIMEOUT’ result.
Generates a ‘408 REQUEST_TIMEOUT’ result.
Attributes
- Inherited from:
- Results
Generates a ‘205 RESET_CONTENT’ result.
Generates a ‘205 RESET_CONTENT’ result.
Attributes
- Inherited from:
- Results
Generates a ‘503 SERVICE_UNAVAILABLE’ result.
Generates a ‘503 SERVICE_UNAVAILABLE’ result.
Attributes
- Inherited from:
- Results
Generates a ‘101 Switching Protocols’ result.
Generates a ‘101 Switching Protocols’ result.
Attributes
- Inherited from:
- Results
Generates a ‘429 TOO_MANY_REQUESTS’ result.
Generates a ‘429 TOO_MANY_REQUESTS’ result.
Attributes
- Inherited from:
- Results
Generates a ‘401 UNAUTHORIZED’ result.
Generates a ‘401 UNAUTHORIZED’ result.
Attributes
- Inherited from:
- Results
Generates a ‘422 UNPROCESSABLE_ENTITY’ result.
Generates a ‘422 UNPROCESSABLE_ENTITY’ result.
Attributes
- Inherited from:
- Results
Generates a ‘415 UNSUPPORTED_MEDIA_TYPE’ result.
Generates a ‘415 UNSUPPORTED_MEDIA_TYPE’ result.
Attributes
- Inherited from:
- Results
Generates a ‘414 REQUEST_URI_TOO_LONG’ result.
Generates a ‘414 REQUEST_URI_TOO_LONG’ result.
Attributes
- Inherited from:
- Results
Attributes
- Inherited from:
- OAuth2ProtectedResourceProvider
Attributes
- Inherited from:
- OAuth2TokenEndpointProvider
Implicits
Inherited implicits
Attributes
- Inherited from:
- OAuth2TokenEndpointProvider
Attributes
- Inherited from:
- OAuth2TokenEndpointProvider
Attributes
- Inherited from:
- OAuth2ProtectedResourceProvider
Attributes
- Inherited from:
- OAuth2ProtectedResourceProvider