Skip to content

Conversation

dhaneshbs
Copy link
Contributor

Added create connection method

* @param connection The data for the new connection
* @returns {Promise<CreateConnectionResponse>} The created connection
*/
async createConnection(organizationId: string, connection: CreateConnection): Promise<CreateConnectionResponse> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My current understanding

When developers try to create a connection using this method:

  • They pass organizationId

  • They pass an object

    • enum: OKTA, ENTRA
    • string: OIDC, SAML

    Problem

Whether this creates SSO Connection or SCIM is not clear.

Proposal
While passing an option as part of a Object is a preferred, like { "feature": "sso" } , this exercise has to be consistent with other APIs. For example, List All Connections API response does not have an equivalent feature property, but provider and type attributes together confirm it's a SSO connection.

List Connections API response
{
  "connections": [
    {
      "id": "conn_2123312131125533",
      "organization_id": "org_1232434",
      "provider": "OKTA",
      "type": "SAML",
      "status": "COMPLETED",
      "enabled": true,
      "debug_enabled": false,
      "configuration_type": "MANUAL",
      "saml_config": {
        "sp_entity_id": "https://yourapp.com/service/saml",
        "sp_assertion_url": "https://youridp.com/service/saml/assertion",
        "sp_metadata_url": "https://youridp.com/service/saml/metadata",
        "idp_metadata_url": "https://youridp.com/service/idp/metadata",
        "idp_sso_url": "https://youridp.com/sso/saml"
      },
      "attribute_mapping": {
        "email": "email",
        "family_name": "lastName",
        "given_name": "firstName",
        "sub": "nameid"
      },
      "create_time": "2024-01-05T14:48:00.000Z"
    }
  ]
}

To stay consistent, we let users pass provider and type as two options together to determine what connection (SSO or SCIM) connection to create. Open for more options, yet to research my bit.

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.

2 participants