Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json Marshalling a ConnectionOptionsOIDC is causing failures when creating a new connection #422

Open
6 tasks done
alexTendo opened this issue Jul 11, 2024 · 2 comments
Open
6 tasks done
Labels
bug Something isn't working

Comments

@alexTendo
Copy link

alexTendo commented Jul 11, 2024

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of this SDK and the issue still persists.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

When I attempt to create an oidc connection with just a discovery url I am receiving the following error.
"options.issuer" must be a string
This was working previously I'm not exactly sure when this broke as we don't use this endpoint very often

Expectation

expected: json to marshal correctly into the following with no null values
actual: json includes null values
example incorrect payload with null values:

{
  "name": "TestConnectionNameNew",
  "display_name": "Test Connection Name New",
  "strategy": "oidc",
  "is_domain_connection": false,
  "options": {
    "client_id": "testClientId",
    "client_secret": "testClientSecret",
    "discovery_url": "[myDiscoveryURL](https://accounts.google.com/.well-known/openid-configuration)",
    "authorization_endpoint": null,
    "issuer": null,
    "jwks_uri": null,
    "type": "back_channel",
    "userinfo_endpoint": null,
    "token_endpoint": null,
    "scope": "openid profile email",
  }
}

If I remove the null values and hit the endpoint directly this is a valid request

Reproduction

  1. Run the following code to create a new connection
	connection := &management.Connection{
		Name:               auth0.String(input.Name),
		DisplayName:        auth0.String(input.DisplayName),
		Strategy:           auth0.String(strategyOidc),
		IsDomainConnection: auth0.Bool(false),
		Options: &management.ConnectionOptionsOIDC{
			Type:         auth0.String(connectionTypeBackChannel),
			ClientID:     auth0.String(input.ClientId),
			ClientSecret: auth0.String(input.ClientSecret),
			DiscoveryURL: auth0.String(input.DiscoveryUrl),
			Scope:        auth0.String(connectionScopes),
		},
	}
	err = client.management.Connection.Create(ctx, connection)

Auth0 Go SDK version

v1.8.0

@alexTendo alexTendo added the bug Something isn't working label Jul 11, 2024
@alexTendo
Copy link
Author

alexTendo commented Jul 12, 2024

I opened this PR to address the issue. Not sure if this is the actual root cause but it at least unblocks the issue I am currently seeing #423

@developerkunal
Copy link
Contributor

Hi @alexTendo,

I hope you are having a nice day!

We are aware of this issue, and our team is actively working on resolving it. It might take some time, but we don't anticipate needing any changes on the SDK side. The new changes should be compatible with the existing setup. I will update you as soon as the team resolves the issue on the API side.

Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants