scalaoauth2.provider

OAuth2Provider

trait OAuth2Provider extends OAuth2BaseProvider

OAuth2Provider supports issue access token and authorize.

Create controller for issue access token
Examples:
  1. import scalaoauth2.provider._
    object BookController extends Controller with OAuthProvider {
      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
        }
      }
    }
  2. ,
  3. POST /oauth2/access_token controllers.OAuth2Controller.accessToken
    Authorized
  4. ,
  5. object OAuth2Controller extends Controller with OAuth2Provider {
    def accessToken = Action.async { implicit request =>
      issueAccessToken(new MyDataHandler())
    }
    }
    Register routes
Linear Supertypes
OAuth2BaseProvider, Results, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. OAuth2Provider
  2. OAuth2BaseProvider
  3. Results
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class Status extends Result

    Definition Classes
    Results

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val Accepted: Status

    Definition Classes
    Results
  7. val BadGateway: Status

    Definition Classes
    Results
  8. val BadRequest: Status

    Definition Classes
    Results
  9. val Conflict: Status

    Definition Classes
    Results
  10. val Created: Status

    Definition Classes
    Results
  11. val EntityTooLarge: Status

    Definition Classes
    Results
  12. val ExpectationFailed: Status

    Definition Classes
    Results
  13. val FailedDependency: Status

    Definition Classes
    Results
  14. val Forbidden: Status

    Definition Classes
    Results
  15. def Found(url: String): Result

    Definition Classes
    Results
  16. val GatewayTimeout: Status

    Definition Classes
    Results
  17. val Gone: Status

    Definition Classes
    Results
  18. val HttpVersionNotSupported: Status

    Definition Classes
    Results
  19. val InsufficientStorage: Status

    Definition Classes
    Results
  20. val InternalServerError: Status

    Definition Classes
    Results
  21. val Locked: Status

    Definition Classes
    Results
  22. val MethodNotAllowed: Status

    Definition Classes
    Results
  23. def MovedPermanently(url: String): Result

    Definition Classes
    Results
  24. val MultiStatus: Status

    Definition Classes
    Results
  25. val NoContent: Result

    Definition Classes
    Results
  26. val NonAuthoritativeInformation: Status

    Definition Classes
    Results
  27. val NotAcceptable: Status

    Definition Classes
    Results
  28. val NotFound: Status

    Definition Classes
    Results
  29. val NotImplemented: Status

    Definition Classes
    Results
  30. val NotModified: Result

    Definition Classes
    Results
  31. val Ok: Status

    Definition Classes
    Results
  32. val PartialContent: Status

    Definition Classes
    Results
  33. val PreconditionFailed: Status

    Definition Classes
    Results
  34. def Redirect(call: Call): Result

    Definition Classes
    Results
  35. def Redirect(url: String, queryString: Map[String, Seq[String]], status: Int): Result

    Definition Classes
    Results
  36. def Redirect(url: String, status: Int): Result

    Definition Classes
    Results
  37. val RequestTimeout: Status

    Definition Classes
    Results
  38. val ResetContent: Result

    Definition Classes
    Results
  39. def SeeOther(url: String): Result

    Definition Classes
    Results
  40. val ServiceUnavailable: Status

    Definition Classes
    Results
  41. def Status(code: Int): Status

    Definition Classes
    Results
  42. def TemporaryRedirect(url: String): Result

    Definition Classes
    Results
  43. val TooManyRequest: Status

    Definition Classes
    Results
  44. val Unauthorized: Status

    Definition Classes
    Results
  45. val UnprocessableEntity: Status

    Definition Classes
    Results
  46. val UnsupportedMediaType: Status

    Definition Classes
    Results
  47. val UriTooLong: Status

    Definition Classes
    Results
  48. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  49. def authorize[A, U](handler: ProtectedResourceHandler[U])(callback: (AuthInfo[U]) ⇒ Future[Result])(implicit request: Request[A], ctx: ExecutionContext): Future[Result]

    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.

    A

    play.api.mvc.Request has type.

    U

    set the type in AuthorizationHandler.

    handler

    Implemented ProtectedResourceHandler for authenticate to your system.

    callback

    Callback is called when authentication is successful.

    request

    Playframework is provided HTTP request interface.

    ctx

    This contxt is used by ProtectedResource.

    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.

  50. def chunk(trailers: Option[Iteratee[Array[Byte], Seq[(String, String)]]]): Enumeratee[Array[Byte], Array[Byte]]

    Definition Classes
    Results
  51. def chunk: Enumeratee[Array[Byte], Array[Byte]]

    Definition Classes
    Results
  52. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. def dechunk: Enumeratee[Array[Byte], Array[Byte]]

    Definition Classes
    Results
  54. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  55. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  56. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  57. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  58. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  59. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  60. def issueAccessToken[A, U](handler: AuthorizationHandler[U])(implicit request: Request[A], ctx: ExecutionContext): Future[Result]

    Issue access token in AuthorizationHandler process and return the response to client.

    Issue access token in AuthorizationHandler process and return the response to client.

    A

    play.api.mvc.Request has type.

    U

    set the type in AuthorizationHandler.

    handler

    Implemented AuthorizationHandler for register access token to your system.

    request

    Playframework is provided HTTP request interface.

    ctx

    This context is used by TokenEndPoint.

    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.

  61. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  62. final def notify(): Unit

    Definition Classes
    AnyRef
  63. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  64. implicit def play2oauthRequest[A](request: Request[A]): AuthorizationRequest

    Definition Classes
    OAuth2BaseProvider
  65. implicit def play2oauthRequest(request: RequestHeader): AuthorizationRequest

    Definition Classes
    OAuth2BaseProvider
  66. implicit def play2protectedResourceRequest[A](request: Request[A]): ProtectedResourceRequest

    Definition Classes
    OAuth2BaseProvider
  67. implicit def play2protectedResourceRequest(request: RequestHeader): ProtectedResourceRequest

    Definition Classes
    OAuth2BaseProvider
  68. val protectedResource: ProtectedResource

    Definition Classes
    OAuth2BaseProvider
  69. def responseAccessToken(r: GrantHandlerResult): Map[String, JsValue]

    Attributes
    protected[scalaoauth2]
    Definition Classes
    OAuth2BaseProvider
  70. def responseOAuthErrorHeader(e: OAuthError): (String, String)

    Attributes
    protected[scalaoauth2]
    Definition Classes
    OAuth2BaseProvider
  71. def responseOAuthErrorJson(e: OAuthError): JsValue

    Attributes
    protected[scalaoauth2]
    Definition Classes
    OAuth2BaseProvider
  72. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  73. def toOAuthErrorString(e: OAuthError): String

    Attributes
    protected
    Definition Classes
    OAuth2BaseProvider
  74. def toString(): String

    Definition Classes
    AnyRef → Any
  75. val tokenEndpoint: TokenEndpoint

    Definition Classes
    OAuth2BaseProvider
  76. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  77. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from OAuth2BaseProvider

Inherited from Results

Inherited from AnyRef

Inherited from Any

Ungrouped