Use custom authentication methods with default provided method in Ktor simultaneously

100 Views Asked by At

I have created one custom authentication method to support HMAC authentication. Now I want to combine this method with JWT authentication that is provided as a default authentication method in Ktor. I want to combine these in such a way that my route can be authenticated by any one of these methods.

I have tried with this

withSignature {
            show()
}

authenticate( "auth-jwt") {
            show()
}

When I am trying to access show() with auth-jwt, it is taking withSignature and throwing error.

I want to access the route by any authentication method, auth-jwt or withSignature.

0

There are 0 best solutions below