OpenId Connect Client written in Kotlin.
A Gist of OpenID Connect
This client is implemented with reference to OpenID Connect Basic Client Implementer's Guide
compile 'io.github.shyamz-22:oidc-jvm-client:$version'
<dependency>
<groupId>io.github.shyamz-22</groupId>
<artifactId>oidc-jvm-client</artifactId>
<version>${version}</version>
</dependency>
- Step 1: Load Client Configuration
ClientConfiguration.
.with()
.client("<your-client-id>",
"<your-redirect-uri>",
"<your-secret>")
.issuer("<issuer-url>")
- Step 2: Make an Authentication Request
AuthenticationRequestBuilder()
.basic()
.build()
.andRedirect(response);
- Step 3: Exchange Code for access token and id token
val user = OpenIdConnectCallBackInterceptor(httpServletRequest)
.extractCode()
.exchangeCodeForTokens()
.extractAuthenticatedUserInfo();
- Step 1: Load Client Configuration
ClientConfiguration.INSTANCE
.with()
.client("<your-client-id>",
"<your-redirect-uri>",
"<your-secret>")
.issuer("<issuer-url>")
- Step 2: Make an Authentication Request
new AuthenticationRequestBuilder()
.basic()
.build()
.andRedirect(response);
- Step 3: Exchange Code for access token and id token
AuthenticatedUser user = new OpenIdConnectCallBackInterceptor(httpServletRequest)
.extractCode(null)
.exchangeCodeForTokens()
.extractAuthenticatedUserInfo(null);