Skip to content

Commit

Permalink
fix well known endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
uakihir0 committed Feb 8, 2025
1 parent a170a71 commit 7a934d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _WellKnownResource(
return proceed<WellKnownOAuthProtectedResourceResponse> {
runBlocking {
HttpRequest()
.url("${config.pdsServer}.well-known/oauth-protected-resource")
.url("${config.pdsServer}/.well-known/oauth-protected-resource")
.accept(MediaType.JSON)
.get()
}
Expand All @@ -37,7 +37,7 @@ class _WellKnownResource(
return proceed<WellKnownOAuthAuthorizationServerResponse> {
runBlocking {
HttpRequest()
.url("${config.authorizationServer}.well-known/oauth-authorization-server")
.url("${config.authorizationServer}/.well-known/oauth-authorization-server")
.accept(MediaType.JSON)
.get()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class OAuthTest : AbstractTest() {
@Test
fun tokenTest() {
val callback = """
http://127.0.0.1/callback?iss=https%3A%2F%2Fbsky.social&state=7px3ldl0huvljddfqur00607mb57x9e55siwcpz3m00lrsx5i06geoyc65g06lmz&code=cod-bca898cc79bd729964492d72c356b37d1ed63561f23c67096844205d6ae56555
{{CALLBACK_URL}}
"""
.trimIndent()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
package work.socialhub.kbsky.auth

import work.socialhub.kbsky.domain.Service.BSKY_SOCIAL
import work.socialhub.kbsky.domain.Service.OYSTER_US_EAST
import kotlin.test.Test

class WellKnownTest : AbstractTest() {

@Test
fun testWellKnownOAuthProtectedResource() {
val response = AuthFactory
.instance(BSKY_SOCIAL.uri)
.instance(OYSTER_US_EAST.uri)
.wellKnown()
.oAuthProtectedResource()
println(response.data.authorizationServers[0])
}

@Test
fun testWell() {
fun testWellKnownOAuthAuthorizationServer() {
val response = AuthFactory
.instance(BSKY_SOCIAL.uri)
.wellKnown()
Expand Down

0 comments on commit 7a934d7

Please sign in to comment.