Arguments
Information to retrieve from your customer. See the IdP Info docs for more information.
idpType: Can equal eitherGeneric,Okta, orMicrosoftEntra.clientId: The Client ID of the OIDC app in your customer's IdP.clientSecret: The Client Secret of the OIDC app in your customer's IdP.usesPkce: If the OIDC app uses PKCE.ssoDomain: Only use when theidpTypeis set toOkta.tenantId: Only use when theidpTypeis set toMicrosoftEntra.authUrl: The Auth URL of the OIDC app in your customer's IdP.tokenUrl: The Token URL of the OIDC app in your customer's IdP.userinfoUrl: The User Info URL of the OIDC app in your customer's IdP.
The ID of the user/group/organization that the OIDC client is getting created for. Each Customer ID is allowed only one OIDC connection. If using SCIM, this value should match the Customer ID of the customer's SCIM connection.
Your application's callback URL that handles the OIDC response and calls Complete OIDC Login. You provide this URL to your customer to register in their IdP.
The user-facing display name for the OIDC client.
Additional scopes to request from the IdP.
The SCIM linking strategy for the OIDC client. Can equal OidcSubToScimUsername, OidcSubToScimExternalId, OidcEmailToScimUsername, OidcEmailUsernameToScimUsername, or OidcPreferredUsernameToScimUsername.
A list of email domains to allow for the OIDC client.
Successful Response
The ID of the created OIDC client
Error Types
One or more provided fields contain invalid values
The specified client ID is already in use
This customer already has an OIDC client configured
An unexpected error occurred during the operation
const auth = createClient({ url, integrationKey });
// For other IdP types, use idpType: "Generic" or "MicrosoftEntra"const result = await auth.sso.management.createOidcClient({ idpInfoFromCustomer: { idpType: "Okta", clientId: "0oaulhbkt9YBiT3Pn697", clientSecret: "MHppDLafzd...", ssoDomain: "example.okta.com", usesPkce: true, }, customerId: "106ce124-108...", redirectUrl: "https://app.example.com/authorization-code/callback", displayName: "Okta OIDC Client", additionalScopes: ["groups"], emailDomainAllowlist: ["example.com"], scimMatchingDefinition: { strategy: "OidcEmailUsernameToScimUsername" }});
if (result.ok) { console.log("OIDC client created successfully"); console.log(`Client ID: ${result.data.clientId}`);} else { console.log(`Error: ${result.error}`); // Check result.error.type to handle specific errors}from propelauth_byo.generated.idp_info_from_customer import IdpInfoFromCustomerOktafrom propelauth_byo.generated.scim_matching_definition import ScimMatchingDefinition
client = create_client(url=url, integration_key=integration_key)
# For other IdP types, use IdpInfoFromCustomerGeneric or IdpInfoFromCustomerMicrosoftEntraresult = await client.sso.management.create_oidc_client( idp_info_from_customer=IdpInfoFromCustomerOkta( client_id="0oaulhbkt9YBiT3Pn697", client_secret="MHppDLafzd...", sso_domain="example.okta.com", uses_pkce=True, ), customer_id="106ce124-108...", redirect_url="https://app.example.com/authorization-code/callback", display_name="Okta OIDC Client", additional_scopes=["groups"], email_domain_allowlist=["example.com"], scim_matching_definition=ScimMatchingDefinition( strategy="OidcEmailUsernameToScimUsername" ))
if is_ok(result): print("OIDC client created successfully") print(f"Client ID: {result.data.client_id}")else: raise HTTPException(status_code=500, detail="Internal server error")PropelAuthClient client = PropelAuthClient.create(url, integrationKey);
// For other IdP types, use IdpInfoFromCustomer.Generic or IdpInfoFromCustomer.MicrosoftEntraCreateOidcClientCommand command = CreateOidcClientCommand.builder() .idpInfoFromCustomer(IdpInfoFromCustomer.Okta.builder() .clientId("0oaulhbkt9YBiT3Pn697") .clientSecret("MHppDLafzd...") .ssoDomain("example.okta.com") .usesPkce(true) .build()) .customerId("106ce124-108...") .redirectUrl("https://app.example.com/authorization-code/callback") .displayName("Okta OIDC Client") .additionalScopes(Arrays.asList("groups")) .emailDomainAllowlist(Arrays.asList("example.com")) .scimMatchingDefinition(ScimMatchingDefinition.builder() .strategy(ScimUserMatchingStrategy.OidcEmailUsernameToScimUsername) .build()) .build();
try { CreateOidcClientResponse response = client.sso.management.createOidcClient(command); System.out.println("OIDC client created successfully"); System.out.println("Client ID: " + response.getClientId());} catch (CreateOidcClientException.InvalidFields e) { System.out.println("Invalid fields: " + e.getDetails());} catch (CreateOidcClientException.ClientIdAlreadyTaken e) { System.out.println("Client ID already taken");} catch (CreateOidcClientException.CustomerIdAlreadyTakenForEoidcClient e) { System.out.println("Customer already has an OIDC client");} catch (CreateOidcClientException e) { System.out.println("Error: " + e.getMessage());}var client = new PropelAuthClient(new PropelAuthOptions { Url = url, IntegrationKey = integrationKey });
// For other IdP types, use IdpInfoFromCustomerGeneric or IdpInfoFromCustomerMicrosoftEntravar command = new CreateOidcClientCommand{ IdpInfoFromCustomer = new IdpInfoFromCustomerOkta { ClientId = "0oaulhbkt9YBiT3Pn697", ClientSecret = "MHppDLafzd...", SsoDomain = "example.okta.com", UsesPkce = true }, CustomerId = "106ce124-108...", RedirectUrl = "https://app.example.com/authorization-code/callback", DisplayName = "Okta OIDC Client", AdditionalScopes = new List<string> { "groups" }, EmailDomainAllowlist = new List<string> { "example.com" }, ScimMatchingDefinition = new ScimMatchingDefinition { Strategy = ScimUserMatchingStrategy.OidcEmailUsernameToScimUsername }};
try{ var response = await client.Sso.Management.CreateOidcClientAsync(command); Console.WriteLine("OIDC client created successfully"); Console.WriteLine($"Client ID: {response.ClientId}");}catch (CreateOidcClientException.InvalidFields ex){ Console.WriteLine($"Invalid fields: {ex.Details}");}catch (CreateOidcClientException.ClientIdAlreadyTaken){ Console.WriteLine("Client ID already taken");}catch (CreateOidcClientException.CustomerIdAlreadyTakenForEoidcClient){ Console.WriteLine("Customer already has an OIDC client");}catch (CreateOidcClientException ex){ Console.WriteLine($"Error: {ex.Message}");}{ ok: true, data: { clientId: "0oaulhbkt9YBiT3Pn697" }}Result( data=CreateOidcClientResponse( client_id="0oaulhbkt9YBiT3Pn697" ))CreateOidcClientResponse( clientId="0oaulhbkt9YBiT3Pn697")CreateOidcClientResponse{ ClientId = "0oaulhbkt9YBiT3Pn697"}