Skip to content

Commit 8b77a10

Browse files
Merge pull request #819 from supertokens/oidc-endpoint-fixes
fix: oidc urls and golang type fix
2 parents f462af4 + f931e54 commit 8b77a10

File tree

27 files changed

+154
-153
lines changed

27 files changed

+154
-153
lines changed

v2/emailpassword/advanced-customizations/backend-sdk-core-interceptor.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ supertokens.Init(supertokens.TypeInput{
7272
ConnectionURI: "...",
7373
APIKey: "...",
7474
// highlight-start
75-
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) *http.Request {
75+
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) (*http.Request, error) {
7676
log.Print("http request to core: %+v", request)
77-
return request
77+
return request, nil
7878
},
7979
// highlight-end
8080
},

v2/passwordless/advanced-customizations/backend-sdk-core-interceptor.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ supertokens.Init(supertokens.TypeInput{
7272
ConnectionURI: "...",
7373
APIKey: "...",
7474
// highlight-start
75-
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) *http.Request {
75+
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) (*http.Request, error) {
7676
log.Print("http request to core: %+v", request)
77-
return request
77+
return request, nil
7878
},
7979
// highlight-end
8080
},

v2/session/advanced-customizations/backend-sdk-core-interceptor.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ supertokens.Init(supertokens.TypeInput{
7272
ConnectionURI: "...",
7373
APIKey: "...",
7474
// highlight-start
75-
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) *http.Request {
75+
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) (*http.Request, error) {
7676
log.Print("http request to core: %+v", request)
77-
return request
77+
return request, nil
7878
},
7979
// highlight-end
8080
},

v2/src/plugins/codeTypeChecking/goEnv/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/go-chi/cors v1.2.1
1010
github.com/gorilla/handlers v1.5.1
1111
github.com/gorilla/mux v1.8.0
12-
github.com/supertokens/supertokens-golang v0.20.0
12+
github.com/supertokens/supertokens-golang v0.24.0
1313
)
1414

1515
require (

v2/src/plugins/codeTypeChecking/goEnv/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
9595
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
9696
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
9797
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
98-
github.com/supertokens/supertokens-golang v0.19.1-0.20240513063720-4180c5c039de h1:oVvV0ySs8KMJDq4ElbLN0wW8DnD8fYoc66fcHhL7TmE=
99-
github.com/supertokens/supertokens-golang v0.19.1-0.20240513063720-4180c5c039de/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8=
100-
github.com/supertokens/supertokens-golang v0.20.0 h1:mQHfF38UF5AWqkRPXyt1CcDUHDt/LvMwY+FCbYez2eo=
101-
github.com/supertokens/supertokens-golang v0.20.0/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8=
98+
github.com/supertokens/supertokens-golang v0.24.0 h1:/Y4PS72K7DHplMSskIsOBnvzpOppzFau/Y6q2X/5VeE=
99+
github.com/supertokens/supertokens-golang v0.24.0/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8=
102100
github.com/twilio/twilio-go v0.26.0 h1:wFW4oTe3/LKt6bvByP7eio8JsjtaLHjMQKOUEzQry7U=
103101
github.com/twilio/twilio-go v0.26.0/go.mod h1:lz62Hopu4vicpQ056H5TJ0JE4AP0rS3sQ35/ejmgOwE=
104102
github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=

v2/src/plugins/codeTypeChecking/jsEnv/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"socket.io": "^4.6.1",
5757
"socketio": "^1.0.0",
5858
"supertokens-auth-react": "^0.42.0",
59-
"supertokens-node": "^19.0.0",
59+
"supertokens-node": "^20.0.0",
6060
"supertokens-node7": "npm:supertokens-node@7.3",
6161
"supertokens-react-native": "^5.0.0",
6262
"supertokens-web-js": "^0.12.0",

v2/thirdparty/advanced-customizations/backend-sdk-core-interceptor.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ supertokens.Init(supertokens.TypeInput{
7272
ConnectionURI: "...",
7373
APIKey: "...",
7474
// highlight-start
75-
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) *http.Request {
75+
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) (*http.Request, error) {
7676
log.Print("http request to core: %+v", request)
77-
return request
77+
return request, nil
7878
},
7979
// highlight-end
8080
},

v2/thirdparty/common-customizations/multi-tenancy/custom-provider.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ async function createTenant() {
326326
scope: ["email", "profile"]
327327
}],
328328
// highlight-start
329-
oidcDiscoveryEndpoint: "https://example.com",
329+
oidcDiscoveryEndpoint: "https://example.com/.well-known/openid-configuration",
330330
// highlight-end
331331
authorizationEndpointQueryParams: { // optional
332332
"someKey1": "value1",
@@ -372,7 +372,7 @@ func main() {
372372
},
373373
},
374374
// highlight-start
375-
OIDCDiscoveryEndpoint: "https://example.com",
375+
OIDCDiscoveryEndpoint: "https://example.com/.well-known/openid-configuration",
376376
// highlight-end
377377
AuthorizationEndpointQueryParams: map[string]interface{}{ // optional
378378
"someKey1": "value1",
@@ -418,7 +418,7 @@ async def some_func():
418418
),
419419
],
420420
# highlight-start
421-
oidc_discovery_endpoint="https://example.com",
421+
oidc_discovery_endpoint="https://example.com/.well-known/openid-configuration",
422422
# highlight-end
423423
authorization_endpoint_query_params={
424424
"someKey1": "value1",
@@ -461,7 +461,7 @@ curl --location --request PUT '^{coreInjector_uri_without_quotes}/<TENANT_ID>/re
461461
"clientSecret": "...",
462462
"scope": ["email", "profile"]
463463
}],
464-
"oidcDiscoveryEndpoint": "https://example.com",
464+
"oidcDiscoveryEndpoint": "https://example.com/.well-known/openid-configuration",
465465
"authorizationEndpointQueryParams": {
466466
"someKey1": "value1",
467467
"someKey2": "value2"
@@ -486,8 +486,6 @@ curl --location --request PUT '^{coreInjector_uri_without_quotes}/<TENANT_ID>/re
486486

487487
- The `tenantId` is a unique ID that identifies the tenant for whom you want to add the custom provider. If not specified, it will add it for the `"public"` tenantId (which is the default one).
488488

489-
- Notice that `oidcDiscoveryEndpoint` doesn't have the `/.well-known/openid-configuration` appended to it. That's because our backend SDK adds this automatically, so you don't need to.
490-
491489
<!-- END COPY SECTION -->
492490

493491
<!-- COPY SECTION -->

v2/thirdparty/common-customizations/multi-tenancy/new-tenant-config.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ async function createTenant() {
193193
clientId: "...",
194194
clientSecret: "...",
195195
}],
196-
oidcDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0",
196+
oidcDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
197197
});
198198

199199
if (resp.createdNew) {
@@ -226,7 +226,7 @@ func main() {
226226
ClientSecret: "...",
227227
},
228228
},
229-
OIDCDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0",
229+
OIDCDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
230230
}, nil, nil)
231231
// highlight-end
232232

@@ -262,7 +262,8 @@ async def update_tenant():
262262
client_id="...",
263263
client_secret="...",
264264
)
265-
]
265+
],
266+
oidc_discovery_endpoint="https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
266267
),
267268
)
268269

@@ -327,7 +328,7 @@ curl --location --request PUT '^{coreInjector_uri_without_quotes}/<TENANT_ID>/re
327328
"clientSecret": "..."
328329
}
329330
],
330-
"oidcDiscoveryEndpoint": "https://login.microsoftonline.com/<directoryId>/v2.0"
331+
"oidcDiscoveryEndpoint": "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration"
331332
}
332333
}'
333334
```

v2/thirdparty/common-customizations/sign-in-and-up/custom-providers.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ SuperTokens.init({
317317
scope: ["profile", "email"]
318318
}],
319319
// highlight-start
320-
oidcDiscoveryEndpoint: "https://example.com",
320+
oidcDiscoveryEndpoint: "https://example.com/.well-known/openid-configuration",
321321
// highlight-end
322322
authorizationEndpointQueryParams: {
323323
"someKey1": "value1",
@@ -368,7 +368,7 @@ func main() {
368368
},
369369
},
370370
// highlight-start
371-
OIDCDiscoveryEndpoint: "https://example.com",
371+
OIDCDiscoveryEndpoint: "https://example.com/.well-known/openid-configuration",
372372
// highlight-end
373373
AuthorizationEndpointQueryParams: map[string]interface{}{ // optional
374374
"someKey1": "value1",
@@ -420,7 +420,7 @@ init(
420420
scope=["email", "profile"],
421421
),
422422
],
423-
oidc_discovery_endpoint="https://example.com",
423+
oidc_discovery_endpoint="https://example.com/.well-known/openid-configuration",
424424
authorization_endpoint_query_params={
425425
"someKey1": "value1",
426426
"someKey2": None,

0 commit comments

Comments
 (0)