Object

io.github.jkobejs.google.oauth4s

ServerToServer

Related Doc: package oauth4s

Permalink

object ServerToServer

ServerToServer provides api for performing Google server-to-server OAuth 2.0 flow. Underneath it communicates to google auth server using HTTP.

See also

https://developers.google.com/identity/protocols/OAuth2ServiceAccount

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

Type Members

  1. final case class AuthResponse(access_token: String, token_type: String, expires_in: Long) extends Product with Serializable

    Permalink

    Represents Authorization Server access token response.

    Represents Authorization Server access token response.

    Access token expires in one hour and can be reused until they expire.

    access_token

    google access token

    token_type

    token type

    expires_in

    when will token expire

  2. final class Authenticator[F[_]] extends AnyRef

    Permalink

    Exposes function which performs authorization and caches it until token is near to expire.

  3. final case class GoogleClaims(issuer: String, scope: String, audience: String, expiration: Instant, issuedAt: Instant, subject: Option[String] = None) extends Product with Serializable

    Permalink

    Represents the JWT Claims used in Google server-to-server oauth

    Represents the JWT Claims used in Google server-to-server oauth

    Times are IEEE Std 1003.1, 2013 Edition time in seconds. They are represented in a java.time.Instant objects. At serialization time, they are represented as Long.

    Note: When feeding Instant instances directly, milliseconds are discarded

    issuer

    Issuer claim, Case insensitive

    scope

    A space-delimited list of the permissions that the application requests

    audience

    The audience Case-sensitive. Can be either a list or a single string

    expiration

    The token expiration time

    issuedAt

    identifies the time at which the JWT was issued

    subject

    Subject, Case-sensitive string when defined

  4. final case class Settings(uri: String, privateKey: String, grantType: String, claims: GoogleClaims) extends Product with Serializable

    Permalink

    Represents settings used to connect to Google OAuth 2.0 server.

    Represents settings used to connect to Google OAuth 2.0 server.

    uri

    url used for creating auth requests

    privateKey

    private key used to sign JWT token

    grantType

    given grant

    claims

    claims specified by Google OAuth 2.0

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def auth[F[_]](settings: Settings, executionContext: ExecutionContext)(implicit arg0: ConcurrentEffect[F]): F[AuthResponse]

    Permalink

    Performs single authorization request.

    Performs single authorization request.

    settings

    Settings

    executionContext

    execution context used to make http requests

    returns

    side effect that evaluates to AuthResponse

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. def resource[F[_]](settings: Settings, executionContext: ExecutionContext)(implicit arg0: ConcurrentEffect[F]): Resource[F, Authenticator[F]]

    Permalink

    Gives access to Authenticator resource that can be used to make multiple authorization requests over time.

    Gives access to Authenticator resource that can be used to make multiple authorization requests over time. It creates http client when it is used and reuses it for every new request. Http client is released when resource is released. Responses are cached until token is near to expire (under one minute). After that it will make new authorization request and cache new token.

    settings

    Settings

    executionContext

    execution context used to make http requests

    returns

    Authenticator resource that can be used to make multiple authorization requests over time.

  17. def stream[F[_]](settings: Settings, executionContext: ExecutionContext)(implicit arg0: ConcurrentEffect[F]): Stream[F, AuthResponse]

    Permalink

    Exposes stream of AuthResponses that can be used to automatically make authorization requests over time.

    Exposes stream of AuthResponses that can be used to automatically make authorization requests over time. Responses are cached until token is near to expire (under one minute). After that it will make new authorization request and cache new token.

    settings

    Settings

    executionContext

    execution context used to make http requests

    returns

    stream of AuthResponses

  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped