Skip to main content

NetID

Follow these steps to add NetID as a social sign-in provider to your project using the Ory Console:

  1. Sign in to Ory Console and select Social Sign-in.

  2. Click the switch next to the NetID logo to start the configuration.

  3. Copy the Redirect URI and save it for later use.

  4. Create a NetID Service and NetID Client.

  5. Enter the Redirect URI you copied from Ory to the Callback URL field of the NetID Client.

  6. After creating the NetID Client, the client is initially in sandbox mode, which is a pre-production state prior to the release of your NetID Service. If you want to test your NetID Client while it is in sandbox mode, you need to create one or more test users, by going to the NetID Service page and clicking Add test user.

  7. Copy the following data from the NetID Client settings to the corresponding fields in the form in the Ory Console:

    • Client ID
    • Client secret (sandbox or live, depending on the status of the NetID Service)
  8. In the Scopes field of the form in the Ory Console, add the following scopes:

    • openid
    • email
  9. In the Data Mapping field of the form in the Ory Console, add the following Jsonnet code snippet, which maps the desired claims to the Ory Identity schema:

    local claims = {
    email_verified: false
    } + std.extVar('claims');

    {
    identity: {
    traits: {
    // Allowing unverified email addresses enables account
    // enumeration attacks, if the value is used for
    // verification or as a password login identifier.
    //
    // Therefore we only return the email if it (a) exists and (b) is marked verified
    // by NetID.
    [if "email" in claims && claims.email_verified then "email" else null]: claims.email,
    },
    },
    }
    danger

    Don't save secrets such as API keys, credentials, or personal data directly in Jsonnet code snippets. Jsonnet code snippets used for data mapping aren't stored in an encrypted format in The Ory Network.

  10. Click Save Configuration.