Skip to content

Commit

Permalink
Merge pull request #819 from supertokens/oidc-endpoint-fixes
Browse files Browse the repository at this point in the history
fix: oidc urls and golang type fix
  • Loading branch information
rishabhpoddar authored Jul 30, 2024
2 parents f462af4 + f931e54 commit 8b77a10
Show file tree
Hide file tree
Showing 27 changed files with 154 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ supertokens.Init(supertokens.TypeInput{
ConnectionURI: "...",
APIKey: "...",
// highlight-start
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) *http.Request {
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) (*http.Request, error) {
log.Print("http request to core: %+v", request)
return request
return request, nil
},
// highlight-end
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ supertokens.Init(supertokens.TypeInput{
ConnectionURI: "...",
APIKey: "...",
// highlight-start
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) *http.Request {
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) (*http.Request, error) {
log.Print("http request to core: %+v", request)
return request
return request, nil
},
// highlight-end
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ supertokens.Init(supertokens.TypeInput{
ConnectionURI: "...",
APIKey: "...",
// highlight-start
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) *http.Request {
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) (*http.Request, error) {
log.Print("http request to core: %+v", request)
return request
return request, nil
},
// highlight-end
},
Expand Down
2 changes: 1 addition & 1 deletion v2/src/plugins/codeTypeChecking/goEnv/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/go-chi/cors v1.2.1
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/supertokens/supertokens-golang v0.20.0
github.com/supertokens/supertokens-golang v0.24.0
)

require (
Expand Down
6 changes: 2 additions & 4 deletions v2/src/plugins/codeTypeChecking/goEnv/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/supertokens/supertokens-golang v0.19.1-0.20240513063720-4180c5c039de h1:oVvV0ySs8KMJDq4ElbLN0wW8DnD8fYoc66fcHhL7TmE=
github.com/supertokens/supertokens-golang v0.19.1-0.20240513063720-4180c5c039de/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8=
github.com/supertokens/supertokens-golang v0.20.0 h1:mQHfF38UF5AWqkRPXyt1CcDUHDt/LvMwY+FCbYez2eo=
github.com/supertokens/supertokens-golang v0.20.0/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8=
github.com/supertokens/supertokens-golang v0.24.0 h1:/Y4PS72K7DHplMSskIsOBnvzpOppzFau/Y6q2X/5VeE=
github.com/supertokens/supertokens-golang v0.24.0/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8=
github.com/twilio/twilio-go v0.26.0 h1:wFW4oTe3/LKt6bvByP7eio8JsjtaLHjMQKOUEzQry7U=
github.com/twilio/twilio-go v0.26.0/go.mod h1:lz62Hopu4vicpQ056H5TJ0JE4AP0rS3sQ35/ejmgOwE=
github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
Expand Down
2 changes: 1 addition & 1 deletion v2/src/plugins/codeTypeChecking/jsEnv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"socket.io": "^4.6.1",
"socketio": "^1.0.0",
"supertokens-auth-react": "^0.42.0",
"supertokens-node": "^19.0.0",
"supertokens-node": "^20.0.0",
"supertokens-node7": "npm:[email protected]",
"supertokens-react-native": "^5.0.0",
"supertokens-web-js": "^0.12.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ supertokens.Init(supertokens.TypeInput{
ConnectionURI: "...",
APIKey: "...",
// highlight-start
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) *http.Request {
NetworkInterceptor: func(request *http.Request, context supertokens.UserContext) (*http.Request, error) {
log.Print("http request to core: %+v", request)
return request
return request, nil
},
// highlight-end
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ async function createTenant() {
scope: ["email", "profile"]
}],
// highlight-start
oidcDiscoveryEndpoint: "https://example.com",
oidcDiscoveryEndpoint: "https://example.com/.well-known/openid-configuration",
// highlight-end
authorizationEndpointQueryParams: { // optional
"someKey1": "value1",
Expand Down Expand Up @@ -372,7 +372,7 @@ func main() {
},
},
// highlight-start
OIDCDiscoveryEndpoint: "https://example.com",
OIDCDiscoveryEndpoint: "https://example.com/.well-known/openid-configuration",
// highlight-end
AuthorizationEndpointQueryParams: map[string]interface{}{ // optional
"someKey1": "value1",
Expand Down Expand Up @@ -418,7 +418,7 @@ async def some_func():
),
],
# highlight-start
oidc_discovery_endpoint="https://example.com",
oidc_discovery_endpoint="https://example.com/.well-known/openid-configuration",
# highlight-end
authorization_endpoint_query_params={
"someKey1": "value1",
Expand Down Expand Up @@ -461,7 +461,7 @@ curl --location --request PUT '^{coreInjector_uri_without_quotes}/<TENANT_ID>/re
"clientSecret": "...",
"scope": ["email", "profile"]
}],
"oidcDiscoveryEndpoint": "https://example.com",
"oidcDiscoveryEndpoint": "https://example.com/.well-known/openid-configuration",
"authorizationEndpointQueryParams": {
"someKey1": "value1",
"someKey2": "value2"
Expand All @@ -486,8 +486,6 @@ curl --location --request PUT '^{coreInjector_uri_without_quotes}/<TENANT_ID>/re

- 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).

- 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.

<!-- END COPY SECTION -->

<!-- COPY SECTION -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ async function createTenant() {
clientId: "...",
clientSecret: "...",
}],
oidcDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0",
oidcDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
});

if (resp.createdNew) {
Expand Down Expand Up @@ -226,7 +226,7 @@ func main() {
ClientSecret: "...",
},
},
OIDCDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0",
OIDCDiscoveryEndpoint: "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
}, nil, nil)
// highlight-end

Expand Down Expand Up @@ -262,7 +262,8 @@ async def update_tenant():
client_id="...",
client_secret="...",
)
]
],
oidc_discovery_endpoint="https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration",
),
)

Expand Down Expand Up @@ -327,7 +328,7 @@ curl --location --request PUT '^{coreInjector_uri_without_quotes}/<TENANT_ID>/re
"clientSecret": "..."
}
],
"oidcDiscoveryEndpoint": "https://login.microsoftonline.com/<directoryId>/v2.0"
"oidcDiscoveryEndpoint": "https://login.microsoftonline.com/<directoryId>/v2.0/.well-known/openid-configuration"
}
}'
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ SuperTokens.init({
scope: ["profile", "email"]
}],
// highlight-start
oidcDiscoveryEndpoint: "https://example.com",
oidcDiscoveryEndpoint: "https://example.com/.well-known/openid-configuration",
// highlight-end
authorizationEndpointQueryParams: {
"someKey1": "value1",
Expand Down Expand Up @@ -368,7 +368,7 @@ func main() {
},
},
// highlight-start
OIDCDiscoveryEndpoint: "https://example.com",
OIDCDiscoveryEndpoint: "https://example.com/.well-known/openid-configuration",
// highlight-end
AuthorizationEndpointQueryParams: map[string]interface{}{ // optional
"someKey1": "value1",
Expand Down Expand Up @@ -420,7 +420,7 @@ init(
scope=["email", "profile"],
),
],
oidc_discovery_endpoint="https://example.com",
oidc_discovery_endpoint="https://example.com/.well-known/openid-configuration",
authorization_endpoint_query_params={
"someKey1": "value1",
"someKey2": None,
Expand Down
Loading

0 comments on commit 8b77a10

Please sign in to comment.