Package

com.twitter

finagle

Permalink

package finagle

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. finagle
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait OAuth2 extends AnyRef

    Permalink

    An entry point API to enable OAuth2 in Finagle services (server-side).

    An entry point API to enable OAuth2 in Finagle services (server-side).

    Issuing a token:

    import com.twitter.finagle.OAuth2
    import com.twitter.finagle.oauth2.{DataHandler, Grant}
    import com.twitter.finagle.http.Request
    import com.twitter.util.Future
    
    val dataHandler: DataHandler[?] = ???
    val request: Request = ??? // contains client credentials
    
    val grant: Future[Grant] = OAuth2.issueAccessToken(request, dataHandler)

    Authorizing a request:

    import com.twitter.finagle.OAuth2
    import com.twitter.finagle.oauth2.{AuthInfo, DataHandler}
    import com.twitter.finagle.http.Request
    import com.twitter.util.Future
    
    val dataHandler: DataHandler[?] = ???
    val request: Request = ??? // contains token
    
    val authInfo: AuthInfo[?] = OAuth2.authorize(request, dataHandler)

    Note both authorize and issueAccessToken may resolve into Future.exception containing OAuthError, which could be converted into a barebones HTTP response via .toResponse:

Value Members

  1. object OAuth2 extends OAuth2

    Permalink
  2. package oauth2

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped