Skip to content

Commit f631ad7

Browse files
committed
Merge branch 'release/0.6.0'
2 parents 7810507 + c5eea9d commit f631ad7

26 files changed

+1734
-1636
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111
with:
1212
fetch-depth: 0
1313
- uses: actions/setup-java@v3
@@ -18,7 +18,7 @@ jobs:
1818
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
1919
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2020
- name: Cache SonarCloud packages
21-
uses: actions/cache@v2
21+
uses: actions/cache@v3
2222
with:
2323
path: ~/.sonar/cache
2424
key: ${{ runner.os }}-sonar

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ Configure your authorization server to allow `http://127.0.0.1/*` as a redirect
2525

2626
```java
2727
// this library will just perform the Authorization Flow:
28-
String tokenResponse = TinyOAuth2.client("oauth-client-id")
28+
var httpResponse = TinyOAuth2.client("oauth-client-id")
2929
.withTokenEndpoint(URI.create("https://login.example.com/oauth2/token"))
3030
.authFlow(URI.create("https://login.example.com/oauth2/authorize"))
3131
.authorize(uri -> System.out.println("Please login on " + uri));
3232

33-
// from this point onwards, please proceed with the JSON/JWT parser of your choice:
34-
String bearerToken = parseJson(tokenResponse).get("access_token");
33+
// from this point onwards, please proceed with the JSON/JWT parser of your choice:
34+
if (httpResponse.statusCode() == 200) {
35+
var jsonString = httpResponse.body()
36+
var bearerToken = parseJson(jsonString).get("access_token");
37+
// ...
38+
}
3539
```
3640

3741
If your authorization server doesn't allow wildcards, you can also configure a fixed path (and even port) via e.g. `setRedirectPath("/callback")` and `setRedirectPorts(8080)`.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>io.github.coffeelibs</groupId>
77
<artifactId>tiny-oauth2-client</artifactId>
8-
<version>0.5.1</version>
8+
<version>0.6.0</version>
99
<name>Tiny OAuth2 Client</name>
1010
<description>Zero Dependency RFC 8252 Authorization Flow</description>
1111
<inceptionYear>2022</inceptionYear>

0 commit comments

Comments
 (0)