Skip to main content

Getting started

About#

This library aims to provide easy integration with OAuth2 providers based on OAuth2 RFC using sttp client. There are multiple JSON implementations, see JSON deserialisation for details.

Installation#

To use this library add following dependency to your build.sbt file

"com.ocadotechnology" %% "sttp-oauth2" % "0.17.0"
"com.ocadotechnology" %% "sttp-oauth2-circe" % "0.17.0" // Or other, see JSON support

Usage#

Depending on your use case, please see documentation for the grant you want to support.

Each grant is implemented in an object with explicit return and error types on methods and additionally, Tagless Final friendly *Provider interface.

All grant implementations require a set of implicit JsonDecoders, e.g.:

import com.ocadotechnology.sttp.oauth2.json.circe.instances._

See JSON deserialisation for details.