InfoThis documentation is just for PropelAuth Components, an optional library for those who want deeper design control over their UIs.Click here to view our standard documentation

SAML Login & Signup

PropelAuth's SAML Login & Signup component allows you to customize your login and signup pages by adding the ability to login with SAML / Enterprise SSO. It is designed to be used when your user has a Login State of LOGIN_REQUIRED.

SAML Login & Signup


Reference APIs

These are the APIs that are used by the above component. You can use these APIs directly in your own code.

loginViaSamlForOrg

Accepts either a domain, email, or org_id and returns a SAML login URL for the specified organization.

Arguments

  • Name
    email
    Type
    string
    Description
    The email of the user.
  • Name
    domain
    Type
    string
    Description
    The domain of the user or organization, such as `acme.com`.
  • Name
    org_id
    Type
    string
    Description
    The ID of the organization.

Response Functions

The response object has a handle function that you can use to handle the response. These functions can be async, and you can return values from them.

  • Name
    success
    Description
    Successful request.
  • Name
    orgNotFound
    Description
    The provided org_id or domain is not tied to an existing org with SAML enabled.
  • Name
    unexpectedOrUnhandled
    Description
    An unexpected error occurred.

Request

const { loginViaSamlForOrg } = useAuthFrontendApis()

const response = await loginViaSamlForOrg({
    // only one of these is required
    email: "test@example.com",
    domain: "acme.com",
    org_id: "1189c444-8a2d-4c41-8b4b-ae43ce79a492"
})
response.handle({
    success(data) {
        // redirect to data.login_url
    },
    orgNotFound(error) {
        console.error('Org not found', error)
    },
    unexpectedOrUnhandled(error) {
        console.error('Unexpected or unhandled', error.user_facing_error)
    },
})

Successful Response

{
    "login_url": "https://example.com/saml/login"
}