Eran Friedland
Eran Friedland

Reputation: 188

no static resource when workinh with spring authorization server and appAuth

I have spring authorization server (latest version) where the following is the redirect configuration for my client:

          redirect-uris:
            - "https://my-domain/auth/oauth2/code"
            - "https://my-domain/auth/oauth2/access_token"
            - "/app.myApp:/oauth2redirect"

Now I have managed to configure my android app with appAuth library

    fun oauth2Login() {
    val config =
        AuthorizationServiceConfiguration(
            parse(BuildConfig.authorizedUri),
            parse(BuildConfig.tokenUri)
        )
    val authorizationRequest = AuthorizationRequest.Builder(
        config,
        BuildConfig.clientId,
        ResponseTypeValues.CODE,
        parse("/app.myApp:/oauth2redirect")
    )
        .setScope("end-user")
        .build()
    val loginIntent = (requireActivity() as MainActivity).service.getAuthorizationRequestIntent(authorizationRequest)
    (requireActivity() as MainActivity).launcher.launch(loginIntent, ActivityOptionsCompat.makeBasic())
}

After entering my user credentials, I get 404 instead of going back to my application here is the exception:

org.springframework.web.servlet.resource.NoResourceFoundException: No static resource app.myApp:/oauth2redirect.
at org.springframework.web.servlet.resource.ResourceHttpRequestHandler.handleRequest(ResourceHttpRequestHandler.java:585) ~[spring-webmvc-6.1.8.jar:6.1.8]
at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:52) ~[spring-webmvc-6.1.8.jar:6.1.8]

any idea how to solve it?

Upvotes: 1

Views: 180

Answers (0)

Related Questions