An open API service indexing awesome lists of open source software.

https://github.com/dniel/demo-micronaut-security-auth2

Configuring both http clients and backend API to handle OAuth2 access token authentication and authorization
https://github.com/dniel/demo-micronaut-security-auth2

kotlin micronaut oauth2 security

Last synced: 5 months ago
JSON representation

Configuring both http clients and backend API to handle OAuth2 access token authentication and authorization

Awesome Lists containing this project

README

          

# Micronaut with oauth authorization and authentication for backend and clients.

## Description
This application is a simple example of how to use Micronaut with oauth authorization and authentication for backend and clients.
It uses the mock-idp as the identity provider to authenticate and authorize the requests.

The local application has a secured endpoint that requires authentication.
And the application is configured to retrieve a token from the mock-idp before calling
HTTPBIN and the local application.

The Application main() function
* starts the mock-idp
* starts the application
* run some tests against the application and httpbin.
* stops the application
* stops the mock-idp

## The output of the application is:

```terminaloutput
/Users/daniel/.gradle/jdks/eclipse_adoptium-21-aarch64-os_x.2/jdk-21.0.9+10/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=64194 -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath /Users/daniel/code/dniel/demo-micronaut-security-auth2/build/classes/kotlin/main:/Users/daniel/code/dniel/demo-micronaut-security-auth2/build/generated/ksp/main/classes:/Users/daniel/code/dniel/demo-micronaut-security-auth2/build/resources/main:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut.openapi/micronaut-openapi-annotations/6.19.1/c03eb93e4e7b89dba11da6f77985bb924b48fdca/micronaut-openapi-annotations-6.19.1.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut.security/micronaut-security-jwt/4.15.0/db0dc1aad3716e2b4d79dd253234a438823c0377/micronaut-security-jwt-4.15.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut.security/micronaut-security-oauth2/4.15.0/988cd98b8cca7b2d8911bb505ce5c2b14692f1c4/micronaut-security-oauth2-4.15.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut.security/micronaut-security/4.15.0/a5f36d6054127f68fb5684d21611a1a8fbb24fd1/micronaut-security-4.15.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-client/4.10.7/fa98ba0e8e41e612cfca8fe35ddc6f70dbe760c2/micronaut-http-client-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-server-netty/4.10.7/d4298750663ad992d8ddc153642384bd7fbc4455/micronaut-http-server-netty-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-jackson-databind/4.10.7/9939be8ad1eb112cdd1695588378fae7c2092ddf/micronaut-jackson-databind-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-inject/4.10.7/9d3db1eb2cc764d0bcaa41f28a0380ccd37f9b3a/micronaut-inject-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/no.nav.security/mock-oauth2-server/3.0.0/23eedf688f1e66486a95d14e70251f4e56e559de/mock-oauth2-server-3.0.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.2.20/5380b19fa1924399b62ce3a1faffebb2b4f82272/kotlin-stdlib-2.2.20.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http/4.10.7/5bdc87b3dbd9e6447146e8f92591cfe066dea625/micronaut-http-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-core/4.10.7/86cd2e099943db1fc341c91a31b7a2183a146456/micronaut-core-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.swagger.core.v3/swagger-annotations/2.2.39/6dd8d96a45750f5795a040e7e4e35f3f599dfd17/swagger-annotations-2.2.39.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.nimbusds/nimbus-jose-jwt/10.5/8ef880fa881a4eb9676dd6c419126aa7753d49f2/nimbus-jose-jwt-10.5.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/jakarta.validation/jakarta.validation-api/3.1.1/ec8622148afc5564235d17af80ea80288d0e7f92/jakarta.validation-api-3.1.1.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut.serde/micronaut-serde-api/2.16.1/d6ad990a950028075a5df51e7bb54c9038d32436/micronaut-serde-api-2.16.1.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut.security/micronaut-security-annotations/4.15.0/bcea1ecf24c71cdcef0414ed76d9e633b8ad0653/micronaut-security-annotations-4.15.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-websocket/4.10.7/a0dcf5865af113ce95abdff4e63637329e125d0b/micronaut-websocket-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-client-core/4.10.7/1017133972cea5c8f878101377ea1a1694637fa7/micronaut-http-client-core-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-netty/4.10.7/ecf5cb780db22bdc70e1d5aeada22d1d3eb3628c/micronaut-http-netty-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-context/4.10.7/9eb81e2ac0517b9c4c7332200cfe55c4d4d7f486/micronaut-context-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler-proxy/4.2.7.Final/a1b6d07504fe98163f49d34c9a5efb22d8e84212/netty-handler-proxy-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/2.0.17/d9e58ac9c7779ba3bf8142aff6c830617a7fe60f/slf4j-api-2.0.17.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-server/4.10.7/840e6dbec27fbc94f6f01905eeb98134dc3ad53e/micronaut-http-server-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http/4.2.7.Final/b734c108854099c421fd94d92d9f865e4d4da853/netty-codec-http-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-jackson-core/4.10.7/4d4980bc6c4fdb189bfa1904cf54649fbec5ca1/micronaut-jackson-core-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.19.2/a720d3946c3a1ab04b780f3b3163d62eee6948a0/jackson-datatype-jdk8-2.19.2.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.19.2/72e73f048b36d9df82aef146bf8b2ae63b2e28e2/jackson-datatype-jsr310-2.19.2.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.19.2/46509399d28f57ca32c6bb4b0d4e10e8f062051e/jackson-databind-2.19.2.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/jakarta.annotation/jakarta.annotation-api/2.1.1/48b9bda22b091b1f48b13af03fe36db3be6e1ae3/jakarta.annotation-api-2.1.1.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/jakarta.inject/jakarta.inject-api/2.0.1/4c28afe1991a941d7702fe1362c365f0a8641d1e/jakarta.inject-api-2.0.1.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/mockwebserver/5.1.0/6c7560de793de925c5d1e0ee5f948dc9c4992be9/mockwebserver-5.1.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.nimbusds/oauth2-oidc-sdk/11.28/93d00492ca749f94f56b29b6b764cefe44d51c77/oauth2-oidc-sdk-11.28.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-context-propagation/4.10.7/5a9e296d5c34cbd47d78793358f3a90970dc1ff4/micronaut-context-propagation-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-core-reactive/4.10.7/79e797b8c786f940666472a23223bb5daa1b9488/micronaut-core-reactive-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-aop/4.10.7/3442d686297ecfa7b696c7af8bf685c7aee8bca2/micronaut-aop-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-json-core/4.10.7/dccdd47905989202dd512cc1f3c8381f6fddc9a7/micronaut-json-core-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-discovery-core/4.10.7/defd013c87f311cfb61ca4cf3e79f7ebc0c5a3a0/micronaut-discovery-core-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-buffer-netty/4.10.7/c44247cbf19d6cad6c201af2a05bdb6b4ba96fca/micronaut-buffer-netty-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http2/4.2.7.Final/ce3234f38c9b7a5f625bc75765fa9b62c99d7f71/netty-codec-http2-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler/4.2.7.Final/7ad8a1f851e2e6fe93cdd091871fda2b81c03b5b/netty-handler-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-socks/4.2.7.Final/9f26324e436e8884bb4aa801a6e9151c0b50a754/netty-codec-socks-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-base/4.2.7.Final/915e381ebabcf115f1c7ff7032d55c48afb50210/netty-codec-base-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport/4.2.7.Final/83ea548981d0d8c4a98027cc1a6f9624f902e142/netty-transport-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-buffer/4.2.7.Final/5555ff561643bf2f8430fb57c24403c0efe15994/netty-buffer-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-common/4.2.7.Final/11aa30df26af4fca3239ac1917f303a280f301e1/netty-common-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-router/4.10.7/bfdd3434b1cce57209e59b3aa5e588900aede07f/micronaut-router-4.10.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-compression/4.2.7.Final/572341bc1ca90fd9d6e47f1d2694aab5258566e9/netty-codec-compression-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.19.2/c5381f11988ae3d424b197a26087d86067b6d7d/jackson-annotations-2.19.2.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.19.2/50f3b4bd59b9ff51a0ed493e7b5abaf5c39709bf/jackson-core-2.19.2.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/mockwebserver3/5.1.0/eeb87eb29d6f435742efb4e58cee94cf3dabcee3/mockwebserver3-5.1.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/junit/junit/4.13.2/8ac9e16d933b6fb43bc7f576336b8f4d7eb5ba12/junit-4.13.2.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/net.minidev/json-smart/2.5.2/95d166b18f95907be0f46cdb9e1c0695eed03387/json-smart-2.5.2.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.github.stephenc.jcip/jcip-annotations/1.0-1/ef31541dd28ae2cefdd17c7ebf352d93e9058c63/jcip-annotations-1.0-1.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.nimbusds/content-type/2.3/e3aa0be212d7a42839a8f3f506f5b990bcce0222/content-type-2.3.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.nimbusds/lang-tag/1.7/97c73ecd70bc7e8eefb26c5eea84f251a63f1031/lang-tag-1.7.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.reactivestreams/reactive-streams/1.0.4/3864a1320d97d7b045f729a326e1e077661f31b7/reactive-streams-1.0.4.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-native-unix-common/4.2.7.Final/89953f04259ea7502cffb313630dd51e00e60669/netty-transport-native-unix-common-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.netty/netty-resolver/4.2.7.Final/5f3e5ef8de03992cd4fb46960dc0085ec1a12a12/netty-resolver-4.2.7.Final.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp-jvm/5.1.0/c17340f19b33c1d28a47b8dc4ae15018aff6dc10/okhttp-jvm-5.1.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/net.minidev/accessors-smart/2.5.2/ce16fd235cfee48e67eda33e684423bba09f7d07/accessors-smart-2.5.2.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/9.8/dc19ecb3f7889b7860697215cae99c0f9b6f6b4b/asm-9.8.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio-jvm/3.15.0/cb3c285187640f543150fcac1ae012bdd778c0e1/okio-jvm-3.15.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.5.19/227519801110b803afd68449f11209bb60703630/logback-classic-1.5.19.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/2.4/e0666b825b796f85521f02360e77f4c92c5a7a07/snakeyaml-2.4.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.micronaut.reactor/micronaut-reactor/3.9.1/db3887115b73801c79150ad6d5825ca320bbe7a0/micronaut-reactor-3.9.1.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.projectreactor/reactor-core/3.7.12/fa00bcb9c8c50c430f1c3930dca28ddc9a888e18/reactor-core-3.7.12.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.20.0/3c5fdd700b08c2120afd8c899ce0f139b30f21d1/jackson-datatype-jdk8-2.20.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.20.0/1af763a5ad4efa536235fafe6b3e690a1d8f071c/jackson-datatype-jsr310-2.20.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.20.0/f0a5e62fbd21285e9a5498a60dccb097e1ef793b/jackson-databind-2.20.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-kotlin/2.20.0/4008f53ae3b50ecab1da28fe31dd104349b3d5b7/jackson-module-kotlin-2.20.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/2.0.21/669e1d35e4ca1797f9ddb2830dd6c36c0ca531e4/kotlin-reflect-2.0.21.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.freemarker/freemarker/2.3.34/c2fa47a1c3b6dcdfca90e952e51211967a4baa54/freemarker-2.3.34.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcpkix-jdk18on/1.81/819fd6f5d170c8b8bf8c5acc73816e9c36574042/bcpkix-jdk18on-1.81.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.5.19/8847d9fcb02c62c338ba26e2b28059dd585ea1a9/logback-core-1.5.19.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.20.0/3c97f7fad069f7cfae639d790bd93d6a0b2dff31/jackson-core-2.20.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.20/6a5e7291ea3f2b590a7ce400adb7b3aea4d7e12c/jackson-annotations-2.20.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-serialization-json-jvm/1.9.0/aea6f7d49fe5c458f8963ee6d4bdaf4a459ab3e7/kotlinx-serialization-json-jvm-1.9.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/io.github.microutils/kotlin-logging-jvm/3.0.5/82f2256aeedccfd9c27ea585274a50bf06517383/kotlin-logging-jvm-3.0.5.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcutil-jdk18on/1.81/e2dd79395ab435094142b6aba219f35adcba0f01/bcutil-jdk18on-1.81.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.9.25/20d44e880a284f7b5cd99dd69450b403073f49b2/kotlin-stdlib-jdk8-1.9.25.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk18on/1.81/d17c094daef57dbd80af71687a475aa6df7cbe54/bcprov-jdk18on-1.81.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-serialization-core-jvm/1.9.0/91448df39c558f7c6147b8bd8db01debe16e0cc1/kotlinx-serialization-core-jvm-1.9.0.jar:/Users/daniel/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.9.25/1c166692314a2639e5edfed0d23ed7eee4a5c7a5/kotlin-stdlib-jdk7-1.9.25.jar com.example.ApplicationKt
12:34:25.146 [main] INFO main - Well-known URL: http://localhost:8081/default/.well-known/openid-configuration
12:34:25.729 [main] INFO main - Well-known endpoint response: {
"issuer" : "http://localhost:8081/default",
"authorization_endpoint" : "http://localhost:8081/default/authorize",
"end_session_endpoint" : "http://localhost:8081/default/endsession",
"revocation_endpoint" : "http://localhost:8081/default/revoke",
"token_endpoint" : "http://localhost:8081/default/token",
"userinfo_endpoint" : "http://localhost:8081/default/userinfo",
"jwks_uri" : "http://localhost:8081/default/jwks",
"introspection_endpoint" : "http://localhost:8081/default/introspect",
"response_types_supported" : [ "code", "none", "id_token", "token" ],
"response_modes_supported" : [ "query", "fragment", "form_post" ],
"subject_types_supported" : [ "public" ],
"id_token_signing_alg_values_supported" : [ "ES256", "ES384", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512" ],
"code_challenge_methods_supported" : [ "plain", "S256" ]
}
__ __ _ _
| \/ (_) ___ _ __ ___ _ __ __ _ _ _| |_
| |\/| | |/ __| '__/ _ \| '_ \ / _` | | | | __|
| | | | | (__| | | (_) | | | | (_| | |_| | |_
|_| |_|_|\___|_| \___/|_| |_|\__,_|\__,_|\__|
12:34:26.035 [main] DEBUG i.m.s.a.AuthenticationModeCondition - CookieBasedAuthenticationModeCondition} is not fulfilled because micronaut.security.authentication is not set.
12:34:26.050 [main] DEBUG i.m.s.o.routes.OauthRouteBuilder - No Oauth controllers found. Skipping registration of routes
12:34:26.205 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 361ms. Server Running: http://localhost:8080
12:34:26.209 [main] INFO com.example.HttpClientLoggingFilter - HttpLoggingFilter initialized.
12:34:26.237 [main] INFO com.example.HttpClientLoggingFilter - >>> HttpLoggingFilter (serviceId=unknown): intercepting POST http://localhost:8081/default/token
12:34:26.303 [default-eventLoopGroup-3-2] INFO com.example.HttpClientLoggingFilter - >>> HttpLoggingFilter (serviceId=httpbin): intercepting GET https://httpbin.org/get
12:34:35.823 [default-eventLoopGroup-3-2] INFO com.example.HttpClientLoggingFilter - >>> HttpLoggingFilter (serviceId=localhttp): intercepting GET http://localhost:8080/secured
12:34:35.855 [default-eventLoopGroup-3-4] DEBUG i.m.s.a.AuthenticationModeCondition - CookieBasedAuthenticationModeCondition} is not fulfilled because micronaut.security.authentication is not set.
12:34:35.858 [default-eventLoopGroup-3-4] DEBUG i.m.s.t.reader.HttpHeaderTokenReader - Looking for bearer token in Authorization header
12:34:35.858 [default-eventLoopGroup-3-4] DEBUG i.m.s.t.reader.DefaultTokenResolver - Token found in request GET /secured
12:34:35.869 [default-eventLoopGroup-3-4] INFO com.example.HttpClientLoggingFilter - >>> HttpLoggingFilter (serviceId=mock-idp): intercepting GET http://localhost:8081/default/jwks
12:34:35.877 [default-eventLoopGroup-3-4] DEBUG i.m.s.t.j.n.ReactiveJwksSignature - JWT Signature verified: eyJraWQiOiJkZWZhdWx0IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjbGllbnQtaWQiLCJhdWQiOiJkZWZhdWx0IiwibmJmIjoxNzYxOTEwNDY2LCJzY29wZSI6InNlY3VyZWQiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODEvZGVmYXVsdCIsImV4cCI6MTc2MTkxNDA2NiwiaWF0IjoxNzYxOTEwNDY2LCJqdGkiOiIyODAwMDY2ZS1lMGZhLTQxZGItOGQ2Zi1mMWQwZTUzMTg3Y2YiLCJ0aWQiOiJkZWZhdWx0In0.XMQuznFzTLe8NNcwsbLIlMa3g7UN8OF8Xt5i59hwsQy9GGf4agB-tMe9_pNnNyeTLnVA9Bfj1qnsy6f7tiOMq6ooktO3nbce4dzO37_d84gyfnq1jmNlbtec4h7ozWSpN_oaO7_hdtghIBHlvUnSuU1VvcakB0pUgnNkQOfB-FzUifRXxeA1oc5iuPyPbS-PVhwx6Jo7qYMwku_QUsk0qkE2cad7pAYwB2cqXkNm96ADjDO-nFOUQnwIGgjsUYFs0Fh4Oo_QYv1EMp3RRRj5opjbniQmLaTyhI5kqx5PXOcGaEu2XiRz4EgXg0eCaOWZqfpKI3RLd2EALz_TPbDBiA
12:34:35.884 [default-eventLoopGroup-3-4] DEBUG i.m.security.filters.SecurityFilter - Attributes: sub=>client-id, aud=>[default], nbf=>Fri Oct 31 12:34:26 CET 2025, scope=>secured, iss=>http://localhost:8081/default, exp=>Fri Oct 31 13:34:26 CET 2025, iat=>Fri Oct 31 12:34:26 CET 2025, jti=>2800066e-e0fa-41db-8d6f-f1d0e53187cf, tid=>default
12:34:35.887 [default-eventLoopGroup-3-4] DEBUG i.m.security.rules.IpPatternsRule - One or more of the IP patterns matched the host address [127.0.0.1]. Continuing request processing.
12:34:35.888 [default-eventLoopGroup-3-4] DEBUG i.m.s.rules.AbstractSecurityRule - The given roles [[secured, isAnonymous(), isAuthenticated()]] matched one or more of the required roles [[secured]]. Allowing the request
12:34:35.888 [default-eventLoopGroup-3-4] DEBUG i.m.security.filters.SecurityFilter - Authorized request GET /secured. The rule provider io.micronaut.security.rules.SecuredAnnotationRule authorized the request.
12:34:35.894 [default-eventLoopGroup-3-2] INFO main - Secured endpoint response: Hello World
12:34:38.405 [default-eventLoopGroup-3-2] INFO com.example.HttpClientLoggingFilter - >>> HttpLoggingFilter (serviceId=localhttp): intercepting GET http://localhost:8080/secured
12:34:38.408 [default-eventLoopGroup-3-4] DEBUG i.m.s.t.reader.HttpHeaderTokenReader - Looking for bearer token in Authorization header
12:34:38.408 [default-eventLoopGroup-3-4] DEBUG i.m.s.t.reader.DefaultTokenResolver - Token found in request GET /secured
12:34:38.413 [default-eventLoopGroup-3-4] DEBUG i.m.s.t.j.n.ReactiveJwksSignature - JWT Signature verified: eyJraWQiOiJkZWZhdWx0IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjbGllbnQtaWQiLCJhdWQiOiJkZWZhdWx0IiwibmJmIjoxNzYxOTEwNDY2LCJzY29wZSI6InNlY3VyZWQiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODEvZGVmYXVsdCIsImV4cCI6MTc2MTkxNDA2NiwiaWF0IjoxNzYxOTEwNDY2LCJqdGkiOiIyODAwMDY2ZS1lMGZhLTQxZGItOGQ2Zi1mMWQwZTUzMTg3Y2YiLCJ0aWQiOiJkZWZhdWx0In0.XMQuznFzTLe8NNcwsbLIlMa3g7UN8OF8Xt5i59hwsQy9GGf4agB-tMe9_pNnNyeTLnVA9Bfj1qnsy6f7tiOMq6ooktO3nbce4dzO37_d84gyfnq1jmNlbtec4h7ozWSpN_oaO7_hdtghIBHlvUnSuU1VvcakB0pUgnNkQOfB-FzUifRXxeA1oc5iuPyPbS-PVhwx6Jo7qYMwku_QUsk0qkE2cad7pAYwB2cqXkNm96ADjDO-nFOUQnwIGgjsUYFs0Fh4Oo_QYv1EMp3RRRj5opjbniQmLaTyhI5kqx5PXOcGaEu2XiRz4EgXg0eCaOWZqfpKI3RLd2EALz_TPbDBiA
12:34:38.414 [default-eventLoopGroup-3-4] DEBUG i.m.security.filters.SecurityFilter - Attributes: sub=>client-id, aud=>[default], nbf=>Fri Oct 31 12:34:26 CET 2025, scope=>secured, iss=>http://localhost:8081/default, exp=>Fri Oct 31 13:34:26 CET 2025, iat=>Fri Oct 31 12:34:26 CET 2025, jti=>2800066e-e0fa-41db-8d6f-f1d0e53187cf, tid=>default
12:34:38.414 [default-eventLoopGroup-3-4] DEBUG i.m.security.rules.IpPatternsRule - One or more of the IP patterns matched the host address [127.0.0.1]. Continuing request processing.
12:34:38.414 [default-eventLoopGroup-3-4] DEBUG i.m.s.rules.AbstractSecurityRule - The given roles [[secured, isAnonymous(), isAuthenticated()]] matched one or more of the required roles [[secured]]. Allowing the request
12:34:38.414 [default-eventLoopGroup-3-4] DEBUG i.m.security.filters.SecurityFilter - Authorized request GET /secured. The rule provider io.micronaut.security.rules.SecuredAnnotationRule authorized the request.
12:34:38.416 [default-eventLoopGroup-3-2] INFO main - Secured endpoint response: Hello World
12:34:40.924 [default-eventLoopGroup-3-2] INFO com.example.HttpClientLoggingFilter - >>> HttpLoggingFilter (serviceId=localhttp): intercepting GET http://localhost:8080/secured
12:34:40.926 [default-eventLoopGroup-3-6] DEBUG i.m.s.t.reader.HttpHeaderTokenReader - Looking for bearer token in Authorization header
12:34:40.926 [default-eventLoopGroup-3-6] DEBUG i.m.s.t.reader.DefaultTokenResolver - Token found in request GET /secured
12:34:40.927 [default-eventLoopGroup-3-6] INFO com.example.HttpClientLoggingFilter - >>> HttpLoggingFilter (serviceId=mock-idp): intercepting GET http://localhost:8081/default/jwks
12:34:40.932 [default-eventLoopGroup-3-4] DEBUG i.m.s.t.j.n.ReactiveJwksSignature - JWT Signature verified: eyJraWQiOiJkZWZhdWx0IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjbGllbnQtaWQiLCJhdWQiOiJkZWZhdWx0IiwibmJmIjoxNzYxOTEwNDY2LCJzY29wZSI6InNlY3VyZWQiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODEvZGVmYXVsdCIsImV4cCI6MTc2MTkxNDA2NiwiaWF0IjoxNzYxOTEwNDY2LCJqdGkiOiIyODAwMDY2ZS1lMGZhLTQxZGItOGQ2Zi1mMWQwZTUzMTg3Y2YiLCJ0aWQiOiJkZWZhdWx0In0.XMQuznFzTLe8NNcwsbLIlMa3g7UN8OF8Xt5i59hwsQy9GGf4agB-tMe9_pNnNyeTLnVA9Bfj1qnsy6f7tiOMq6ooktO3nbce4dzO37_d84gyfnq1jmNlbtec4h7ozWSpN_oaO7_hdtghIBHlvUnSuU1VvcakB0pUgnNkQOfB-FzUifRXxeA1oc5iuPyPbS-PVhwx6Jo7qYMwku_QUsk0qkE2cad7pAYwB2cqXkNm96ADjDO-nFOUQnwIGgjsUYFs0Fh4Oo_QYv1EMp3RRRj5opjbniQmLaTyhI5kqx5PXOcGaEu2XiRz4EgXg0eCaOWZqfpKI3RLd2EALz_TPbDBiA
12:34:40.933 [default-eventLoopGroup-3-4] DEBUG i.m.security.filters.SecurityFilter - Attributes: sub=>client-id, aud=>[default], nbf=>Fri Oct 31 12:34:26 CET 2025, scope=>secured, iss=>http://localhost:8081/default, exp=>Fri Oct 31 13:34:26 CET 2025, iat=>Fri Oct 31 12:34:26 CET 2025, jti=>2800066e-e0fa-41db-8d6f-f1d0e53187cf, tid=>default
12:34:40.933 [default-eventLoopGroup-3-4] DEBUG i.m.security.rules.IpPatternsRule - One or more of the IP patterns matched the host address [127.0.0.1]. Continuing request processing.
12:34:40.933 [default-eventLoopGroup-3-4] DEBUG i.m.s.rules.AbstractSecurityRule - The given roles [[secured, isAnonymous(), isAuthenticated()]] matched one or more of the required roles [[secured]]. Allowing the request
12:34:40.933 [default-eventLoopGroup-3-4] DEBUG i.m.security.filters.SecurityFilter - Authorized request GET /secured. The rule provider io.micronaut.security.rules.SecuredAnnotationRule authorized the request.
12:34:40.935 [default-eventLoopGroup-3-2] INFO main - Secured endpoint response: Hello World
12:34:43.486 [Thread-0] INFO io.micronaut.runtime.Micronaut - Embedded Application shutting down

Process finished with exit code 0
```