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

Added missing self-service SSO request parameters #772

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kll2105
Copy link

@kll2105 kll2105 commented Jan 25, 2025

Changes

Added missing self-service SSO request parameters per https://auth0.com/docs/authenticate/enterprise-connections/self-service-SSO#generate-an-access-ticket

References

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change has been tested on the latest version of the platform/language or why not

Checklist

@kll2105 kll2105 requested a review from a team as a code owner January 25, 2025 15:13
@kailash-b
Copy link
Contributor

Thanks for taking time and helping in making this repo better @kll2105
I just have a minor comment as above, while you make the change, could you also ensure to verify your commit?
You could follow the instructions here.

This has been a recent change and we are updating our ReadMe (contribution guidelines) to include this pre-requisite.

@rhumborl
Copy link

This will be really useful, thanks 😃

There is also an options object on SelfServiceSsoConnectionConfig that may as well be added at the same time (would have been nice if domain_aliases could have been called realms to match the Connection API but hey).

image

@kailash-b
Copy link
Contributor

Hi @rhumborl
Thanks for showing interest.
We are currently on this and intend to support the above ask by end of March 2025.

@rhumborl
Copy link

Workaround
Good to hear. We are using our own inherited classes until this is added, which seems to work well enough, if anyone is in the same situation:

/// <summary>Extends <see cref="EnabledOrganization"/> passed to self-service tickets</summary>
public class EnabledOrganizationEx : EnabledOrganization
{
    [JsonProperty("assign_membership_on_login")]
    public bool AssignMembershipOnLogin { get; set; } = false;
}

/// <summary>Extends <see cref="SelfServiceSsoConnectionConfig"/> passed to self-service tickets</summary>
public class SelfServiceSsoConnectionConfigEx : SelfServiceSsoConnectionConfig
{
    [JsonProperty("options")]
    public SelfServiceSsoConnectionConfigOptionsEx? Options { get; set; }
}

/// <summary>Adds Options to <see cref="SelfServiceSsoConnectionConfig"/> when creating a self-service tickets</summary>
public class SelfServiceSsoConnectionConfigOptionsEx
{
    [JsonProperty("domain_aliases")]
    public string[]? DomainAliases { get; set; }

    // add icon_url and idpinitiated if you need it
}


var ticket = await apiClient.SelfServiceProfilesClient.CreateSsoTicketAsync("ssp_blah123", new()
{
    ConnectionConfig = new SelfServiceSsoConnectionConfigEx()
    {
        Name = "myconnection",
        Options = new SelfServiceSsoConnectionConfigOptionsEx { DomainAliases = ["foo.com"] }
    },
    EnabledOrganizations = [
        new EnabledOrganizationEx() { OrganizationId = "org_bar123", AssignMembershipOnLogin = true }
    ],
    EnabledClients = ["myclientid"]
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants