Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions OAuth2-Authorization-Server-Tests.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@
}
],
"url": {
"raw": "{{base_url}}/.well-known/openid_configuration",
"raw": "{{base_url}}/.well-known/openid-configuration",
"host": [
"{{base_url}}"
],
"path": [
".well-known",
"openid_configuration"
"openid-configuration"
]
},
"description": "Get OpenID Connect configuration"
Expand Down Expand Up @@ -369,6 +369,19 @@
{
"name": "Exchange Code for Token",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const code = pm.environment.get('authorization_code');",
"if (!code || code.trim() === '') {",
" console.log('Skipping Exchange Code for Token - authorization_code not set. Complete browser login first.');",
" pm.execution.skipRequest();",
"}"
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
Expand Down Expand Up @@ -466,6 +479,19 @@
{
"name": "Refresh Access Token",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const token = pm.environment.get('refresh_token');",
"if (!token || token.trim() === '') {",
" console.log('Skipping Refresh Access Token - refresh_token not set. Run Exchange Code for Token first.');",
" pm.execution.skipRequest();",
"}"
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/example/config/RegisteredClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ public ApplicationRunner seedClients(RegisteredClientRepository registeredClient
.authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS)
.redirectUri("http://localhost:9000/login/oauth2/code/test-client")
.redirectUri("http://localhost:9000/authorized")
.redirectUri("https://oauth.pstmn.io/v1/callback")
.scope(OidcScopes.OPENID)
.scope(OidcScopes.PROFILE)
.scope("read")
.scope("write")
.clientSettings(ClientSettings.builder()
.requireAuthorizationConsent(true)
.requireProofKey(true)
.requireProofKey(false)
.build())
.tokenSettings(TokenSettings.builder()
.accessTokenTimeToLive(Duration.ofHours(1))
Expand Down
Loading