Skip to content

Commit

Permalink
release 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuyoshizawa committed Oct 6, 2023
1 parent 49e52ff commit 2e2ac6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ In this case, you need to implement your own OAuth provider working with web fra

```scala
libraryDependencies ++= Seq(
"com.nulab-inc" %% "scala-oauth2-core" % "1.5.0"
"com.nulab-inc" %% "scala-oauth2-core" % "1.6.0"
)
```

## How to use

### Implement DataHandler

Whether you use Play Framework or not, you have to implement ```DataHandler``` trait and make it work with your own ```User``` class that may be already defined in your application.
Whether you use Play Framework or not, you have to implement `DataHandler` trait and make it work with your own `User` class that may be already defined in your application.

```scala
case class User(id: Long, name: String, hashedPassword: String)
Expand Down Expand Up @@ -72,14 +72,14 @@ class MyDataHandler extends DataHandler[User] {
}
```

If your data access is blocking for the data storage, then you just wrap your implementation in the ```DataHandler``` trait with ```Future.successful(...)```.
If your data access is blocking for the data storage, then you just wrap your implementation in the `DataHandler` trait with `Future.successful(...)`.

For more details, refer to Scaladoc of ```DataHandler```.
For more details, refer to Scaladoc of `DataHandler`.

### AuthInfo

```DataHandler``` returns ```AuthInfo``` as authorized information.
```AuthInfo``` is made up of the following fields.
`DataHandler` returns `AuthInfo` as authorized information.
`AuthInfo` is made up of the following fields.

```scala
case class AuthInfo[User](
Expand All @@ -93,11 +93,11 @@ case class AuthInfo[User](
```

- user
- ```user``` is authorized by DataHandler
- `user` is authorized by DataHandler
- clientId
- ```clientId``` which is sent from a client has been verified by ```DataHandler```
- If your application requires client_id for client authentication, you can get ```clientId``` as below
- ```val clientId = authInfo.clientId.getOrElse(throw new InvalidClient())```
- `clientId` which is sent from a client has been verified by `DataHandler`
- If your application requires client_id for client authentication, you can get `clientId` as below
- `val clientId = authInfo.clientId.getOrElse(throw new InvalidClient())`
- scope
- inform the client of the scope of the access token issued
- redirectUri
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ lazy val root = (project in file("."))
scalaOAuth2ProviderSettings,
name := "scala-oauth2-core",
description := "OAuth 2.0 server-side implementation written in Scala",
version := "1.5.1-SNAPSHOT",
version := "1.6.0",
libraryDependencies ++= commonDependenciesInTestScope
)

0 comments on commit 2e2ac6c

Please sign in to comment.