sttp-oauth2 - OAuth2 client library for Scala
This library aims to provide easy integration with OAuth2 providers based on OAuth2 RFC using sttp client. It uses circe for JSON serialization/deserialization.
Currently it supports methods (grant types) for obtaining authorization:
Usage
Each grant is implemented in an object with explicit return and error types on methods and additionally, TaglessFinal friendly *Provider
interface.
AuthorizationCode
andAuthorizationCodeProvider
- provide functionality for:- generating login and logout redirect links,
authCodeToToken
for converting authorization code to token,refreshAccessToken
for performing a token refresh request
PasswordGrant
andPasswordGrantProvider
, capable of performingrequestToken
to convert user login and password to oauth2 tokenClientCredentials
andClientCredentialsProvider
expose methods that:- Obtain token via
requestToken
introspect
the token for it's details likeUserInfo
- Obtain token via
The library is using sttp 3. The latest version which is using sttp 2 is 0.4.0
.
Contributing
Feel free to submit feature requests and bug reports under Issues.
License
sttp-oauth2 is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.
Copyright © 2020 Ocado