https://kotlinlang.org logo
Join SlackCommunities
Powered by
# myndocs-oauth2-server
  • a

    Albert

    08/15/2018, 12:38 PM
    set the channel description: Channel for https://github.com/adhesivee/kotlin-oauth2-server
  • s

    savrov

    12/23/2018, 9:31 PM
    hello, anybody alive?
  • a

    Albert

    12/24/2018, 7:47 AM
    Hi yes 😀
  • a

    Albert

    12/24/2018, 7:50 AM
    I just see the question posted in ktor. The Oauth2TokenService isnt exposed in a convenient way. What kind of features do you need of that class @savrov?
  • a

    Albert

    12/24/2018, 8:32 AM
    Otherwise you could do:
    Copy code
    val customTokenService = Oauth2TokenServiceBuilder.build {
      // ... Config ...
    }
    embeddedServer(Netty, 8080) {
        install(Oauth2ServerFeature) {
                tokenService = customTokenService
        }
    }
    But the idea of this library is to let handle tasks for you, so this wouldnt be the recommended way
  • s

    savrov

    12/24/2018, 10:42 AM
    im doing like your snippet says. Right this way, and i dont like it, I wonder if library can handle these operations by itself. My code is below. And thank you for a response @Albert 🙂
    Untitled.kt
    v
    • 2
    • 1
  • a

    Albert

    12/24/2018, 10:56 AM
    The idea is that if you leave routing block away then it should act the same. Requests should get intercepted and do the behavior you are defining there
  • a

    Albert

    12/24/2018, 10:57 AM
    Basic authentication is used by default
  • a

    Albert

    12/24/2018, 10:59 AM
    https://github.com/myndocs/kotlin-oauth2-server/blob/develop/oauth2-server-core/src/main/java/nl/myndocs/oauth2/config/ConfigurationBuilder.kt#L43
  • s

    savrov

    12/24/2018, 11:03 AM
    i expected the same - /auth & /token endpoints should be implemented inside library, but if i remove the “route” block, all these endpoints return 404 status code
  • a

    Albert

    12/24/2018, 11:05 AM
    Could you replace
    <http://0.0.0.0:8080/auth>
    with
    /auth
    and check again? Otherwise it is a bug
  • s

    savrov

    12/24/2018, 11:13 AM
    neither
    /auth
    neither default
    /oauth/authorize
    doesnt work
  • a

    Albert

    12/24/2018, 11:16 AM
    The defaults are defined here https://github.com/myndocs/kotlin-oauth2-server/blob/develop/oauth2-server-core/src/main/java/nl/myndocs/oauth2/config/CallRouterBuilder.kt#L10. I will try to test your solution in the coming days (holidays and all 😛 )
  • a

    Albert

    12/24/2018, 11:17 AM
    Oh I read to fast, you found it. I will try to reproduce
  • s

    savrov

    12/24/2018, 11:18 AM
    Have a great xmas, man! Thank you for a help
  • a

    Albert

    12/24/2018, 11:18 AM
    You too 👍
  • v

    Velastroll

    04/30/2019, 2:49 PM
    Hey! I'm new and i dont understand how to use the framework with Ktor. At first, i've installed it and I've configured the identities and clients, but then how can I protect any paths? or how can I check the user against the database instead of use only the default identities written at first? Anyone has a project to see as example?
  • a

    Albert

    04/30/2019, 6:21 PM
    @Velastroll Securing paths is a feature of the framework itself see https://ktor.io/servers/features/authentication/oauth.html If you want to create your own identity store you could take a look at https://github.com/myndocs/kotlin-oauth2-server/blob/develop/oauth2-server-identity-inmemory/src/main/java/nl/myndocs/oauth2/identity/inmemory/InMemoryIdentity.kt and change it to check it with a database
  • a

    Albert

    09/07/2019, 7:50 PM
    new release available https://github.com/myndocs/kotlin-oauth2-server/releases/tag/0.6.0
    👏 1
  • s

    solidogen

    01/25/2021, 10:14 AM
    hi, any samples for ktor integration? Many people see this and step away because they are BE newcomers
  • a

    Albert

    01/25/2021, 10:20 AM
    Only that I have for ktor is: https://github.com/myndocs/kotlin-oauth2-server/blob/develop/docs/ktor.md
  • a

    Albert

    01/25/2021, 10:21 AM
    That is how to get the configuration, other configuration can be read here: https://github.com/myndocs/kotlin-oauth2-server