Skip to content

Latest commit

 

History

History
44 lines (40 loc) · 1.2 KB

javalin.md

File metadata and controls

44 lines (40 loc) · 1.2 KB

Javalin

Dependencies

Maven

<dependency>
    <groupId>nl.myndocs</groupId>
    <artifactId>oauth2-server-javalin</artifactId>
    <version>${myndocs.oauth.version}</version>
</dependency>

Gradle

implementation "nl.myndocs:oauth2-server-javalin:$myndocs_oauth_version"

Implementation

Javalin.create().apply {
    enableOauthServer {
        identityService = InMemoryIdentity()
                .identity {
                    username = "foo"
                    password = "bar"
                }
        clientService = InMemoryClient()
                .client {
                    clientId = "testapp"
                    clientSecret = "testpass"
                    scopes = setOf("trusted")
                    redirectUris = setOf("https://localhost:7000/callback")
                    authorizedGrantTypes = setOf(
                            AuthorizedGrantType.AUTHORIZATION_CODE,
                            AuthorizedGrantType.PASSWORD,
                            AuthorizedGrantType.IMPLICIT,
                            AuthorizedGrantType.REFRESH_TOKEN
                    )
                }
        tokenStore = InMemoryTokenStore()
    }
}.start(7000)