Skip to main content

Configure custom keystores for authentication protocols

By default, WSO2 Identity Server uses the private key and certificate from the primary keystore in all authentication flows such as,

  • Signing JWT tokens in OAuth authentication flows
  • Verifying JWT tokens signed by WSO2 identity server
  • Signing SAML assertions in SAML authentication flows

WSO2 Identity Server also allows configuring separate keystores for each authentication protocol.

This document provides step-by-step instructions to configure a custom keystore for a specific authentication protocol. You can define multiple custom keystores and assign each to a different protocol as needed.

note

Currently only the following authentication protocols are supported,

  • OAuth 2.0
  • WS-Federation
  • WS-Trust (Needs to be added via the WS-Trust connector)
  • SAML

Configure custom keystore for OAuth, WS-Trust or WS-Federation​

  1. Locate your custom key store file in <IS_HOME>/repository/resources/security/ directory.

  2. Add the following configuration to deployment.toml file.

    [[keystore.custom]]
    file_name = "<keystore name>"
    password = "<password>"
    type = "JKS"
    alias = "<private key alias>"
    key_password = "<password>"

    Configuration parameters,

    ConfigurationDetails
    file_nameKey store file name.
    passwordKey Store password.
    typeKey Store Type.
    aliasAlias value of the private key.
    key_passwordPrivate key password.
  3. Map the Custom KeyStore to Authentication Protocols

    This configuration maps the custom key stores configured above to different authentication protocols. As of now, the following authentication protocols are supported,

    [keystore.mapping.oauth]
    keystore_file_name = "<keystore name>"
    use_in_all_tenants = true

    Configuration parameters,

    ConfigurationDetailsDefault Value
    keystore_file_nameThe file name of the custom keystore. (Should exactly match the file name given in the previous configuration)(Required)
    use_in_all_tenantsDecide whether this configuration will apply to all tenants or the super tenant only.false

Configure custom keystore for SAML​

  1. Locate your custom key store file in <IS_HOME>/repository/resources/security/ directory.

  2. Add the following configuration to deployment.toml file.

    [keystore.saml]
    file_name = "<keystore name>"
    password = "<password>"
    type = "JKS"
    alias = "<private key alias>"
    key_password = "<password>"

    Configuration parameters,

    ConfigurationDetails
    file_nameKey store file name.
    passwordKey Store password.
    typeKey Store Type.
    aliasAlias value of the private key.
    key_passwordPrivate key password.

Was this page helpful?