This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

The responsibility of the inbound authenticators component is to identify and parse all the incoming authentication requests and then build the corresponding response. A given inbound authenticator has two parts.

  • Request Processor
  • Response Builder

For each protocol supported by the WSO2 Identity Server, there should be an inbound authenticator. The Identity Server includes inbound authenticators for SAML 2.0, OpenID, OpenID Connect, OAuth 2.0, Kerberos KDC, WS-Trust STS and WS-Federation (passive). The responsibility of the SAML 2.0 request processor is to accept a SAML request from a service provider, validate the SAML request and then build a common object model understood by the authentication framework and handover the request to it. The responsibility of the SAML response builder is to accept a common object model from the authentication framework and build a SAML response out of it.

Both the request processors and the response builders are protocol aware, while the authentication framework is not coupled to any protocol. See Architecture for more information on the complete flow where inbound authenticators come into play.

You can configure the following for inbound authentication.

Configuring SAML2 web single-sign-on

  1. Expand the SAML2 Web SSO Configuration and click Configure.
  2. Fill in the form that appears.
  3. Click Register.

The following points should be taken into consideration when filling the above New Service Provider form.

FieldDescriptionSample value
IssuerSpecify the Issuer. This is the <saml:Issuer> element that contains the unique identifier of the service provider. This is also the issuer value specified in the SAML Authentication Request issued by the service provider. When configuring single-sign-on across Carbon servers, ensure that this value is equal to the ServiceProviderID value mentioned in the <IS_HOME>/repository/conf/security/authenticators.xml file of the relying party Carbon server. 
Assertion Consumer URLsSpecify the Assertion Consumer URLs. This is the URL to which the browser should be redirected to after the authentication is successful. This is the Assertion Consumer Service (ACS) URL of the service provider. The identity provider redirects the SAML2 response to this ACS URL. However, if the SAML2 request is signed and SAML2 request contains the ACS URL, the Identity Server will honor the ACS URL of the SAML2 request. It should have this format: https://(host-name):(port)/acs. You can add multiple assertion consumer URLs for the service provider by entering the URL and clicking the Add button. 
Default Assertion Consumer URL

Since there can be multiple assertion consumer URLs, you must define a Default Assertion Consumer URL in case you are unable to retrieve it from the authentication request.

Tip: In a service provider initiated single sign-on setup, the following needs to be considered.

 

  • If no ACS URL is given in the <AuthnRequest>, the Identity Server sends the response to the default ACS URL of the service provider (whether the request is signed or not).
  • If the ACS URL in <AuthnRequest> matches with one of the registered URLs, the Identity Server sends the response to the matched one. 
  • If the ACS URL in <AuthnRequest> does not match any of the registered ACS URLs and if the request is signed, the Identity Server sends the response to the ACS URL in the request only if the signature is valid. Alternatively, the <AuthnRequest> is rejected.

In an identity provider initiated single sign-on setup, the following needs to be considered.

  • If the “acs” query parameter is not present in the request, the Identity Server sends the response to default ACS URL of the service provider.
  • If the "acs” parameter is present and the value of that parameter matches with any of the registered ACS URLs of the service provider, then the Identity Server sends the response to the matched one.
 
NameID format

Specify the NameID format. This defines the name identifier formats supported by the identity provider. The service provider and identity provider usually communicate with each other regarding a specific subject. That subject should be identified through a Name-Identifier (NameID) , which should be in some format so that It is easy for the other party to identify it based on the format. Name identifiers are used to provide information regarding a user. 

About NameID formats

For SSO interactions, you can use the following types of NameID formats.

  • urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
  • urn:oasis:names:tc:SAML:2.0:nameid-format:transient
  • urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
  • urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
  • urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
  • urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
  • urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
  • urn:oasis:names:tc:SAML:2.0:nameid-format:entity

This specifies the name identifier format that the Identity Server wants to receive in the subject of an assertion from a particular identity provider. The following is the default format used by the identity provider.

  • urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
 
Signing Algorithm

Specifies the ‘SignatureMethod’ algorithm to be used in the ‘Signature’ element in POST binding. The default value can be configured in the <IS_HOME>/repository/conf/identity.xml file, in the SSOService element with SAMLDefaultSigningAlgorithmURI tag. If it is not provided the default algorithm is RSA­SHA 1, at URI ‘http://www.w3.org/2000/09/xmldsig#rsa­sha1.

 
Digest Algorithm

Specifies the ‘DigestMethod’ algorithm to be used in the ‘Signature’ element in POST binding. The default value can be configured in the <IS_HOME>/repository/conf/identity.xml file, in the SSOService element with SAMLDefaultDigestAlgorithmURI tag. If it is not provided the default algorithm is SHA 1, at URI ‘http://www.w3.org/2000/09/xmldsig#sha1.

 
Enable Response SigningSelect Enable Response Signing to sign the SAML2 Responses returned after the authentication process. 
Enable Signature Validation in Authentication Requests and Logout Requests Select Enable Signature Validation in Authentication Requests and Logout Requests if you need this functionality configured. This specifies whether the identity provider must validate the signature of the SAML2 authentication request and the SAML2 logout request that are sent by the service provider.  
Enable Assertion EncryptionEnable Assertion Encryption, if you wish to encrypt the assertion. 
Certificate Alias

Select the Certificate Alias from the dropdown. This is used to validate the signature of SAML2 requests and is used to generate encryption. Basically the service provider’s certificate must be selected here. Note that this can also be the Identity Server tenant's public certificate in a scenario where you are doing a tenant specific configuration.

 
 
Enable Single LogoutSelect Enable Single Logout so that all sessions are terminated once the user signs out from one server. If single logout is enabled, the identity provider sends logout requests to all service providers. Basically, the identity provider acts according to the single logout profile. If the service provider supports a different URL for logout, you can enter a SLO Response URL and SLO Request URL for logging out. These URLs indicate where the request and response should go to. If you do not specify this URL, the identity provider uses the Assertion Consumer Service (ACS) URL.  
Enable Attribute Profile Select Enable Attribute Profile to enable this and add a claim by entering the claim link and clicking the Add Claim button. The Identity Server provides support for a basic attribute profile where the identity provider can include the user’s attributes in the SAML Assertions as part of the attribute statement. Once you select the checkbox to Include Attributes in the Response Always, the identity provider always includes the attribute values related to the selected claims in the SAML attribute statement. 
Enable Audience RestrictionSelect Enable Audience Restriction to restrict the audience. You may add audience members using the Audience text box and clicking the Add button. 
Enable Recipient Validation   
Enable IdP Initiated SSOSelect the Enable IdP Initiated SSO checkbox to enable this functionality. When this is enabled, the service provider is not required to send the SAML2 request.  
Enable IdP Initiated SLOSelect the Enable IdP Initiated SLO checkbox to enable this functionality. 
   
   

 

  • Specify the Issuer. This is the <saml:Issuer> element that contains the unique identifier of the service provider. This is also the issuer value specified in the SAML Authentication Request issued by the service provider. When configuring single-sign-on across Carbon servers, ensure that this value is equal to the ServiceProviderID value mentioned in the <IS_HOME>/repository/conf/security/authenticators.xml file of the relying party Carbon server.

  • Specify the Assertion Consumer URLs. This is the URL to which the browser should be redirected to after the authentication is successful. This is the Assertion Consumer Service (ACS) URL of the service provider. The identity provider redirects the SAML2 response to this ACS URL. However, if the SAML2 request is signed and SAML2 request contains the ACS URL, the Identity Server will honor the ACS URL of the SAML2 request. It should have this format: https://(host-name):(port)/acs. You can add multiple assertion consumer URLs for the service provider by entering the URL and clicking the Add button. 

  • Since there can be multiple assertion consumer URLs, you must define a Default Assertion Consumer URL in case you are unable to retrieve it from the authentication request.

    Tip: In a service provider initiated single sign-on setup, the following needs to be considered.

    - If no ACS URL is given in the <AuthnRequest>, the Identity Server sends the response to the default ACS URL of the service provider (whether the request is signed or not).
    - If the ACS URL in <AuthnRequest> matches with one of the registered URLs, the Identity Server sends the response to the matched one.
    - If the ACS URL in <AuthnRequest> does not match any of the registered ACS URLs and if the request is signed, the Identity Server sends the response to the ACS URL in the request only if the signature is valid. Alternatively, the <AuthnRequest> is rejected.

    In an identity provider initiated single sign-on setup, the following needs to be considered.
    - If the “acs” query parameter is not present in the request, the Identity Server sends the response to default ACS URL of the service provider.
    - If the "acs” parameter is present and the value of that parameter matches with any of the registered ACS URLs of the service provider, then the Identity Server sends the response to the matched one.

  • Specify the NameID format. This defines the name identifier formats supported by the identity provider. The service provider and identity provider usually communicate with each other regarding a specific subject. That subject should be identified through a Name-Identifier (NameID) , which should be in some format so that It is easy for the other party to identify it based on the format. Name identifiers are used to provide information regarding a user. 

    About NameID formats

    For SSO interactions, you can use the following types of NameID formats.

    • urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
    • urn:oasis:names:tc:SAML:2.0:nameid-format:transient
    • urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
    • urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
    • urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
    • urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
    • urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
    • urn:oasis:names:tc:SAML:2.0:nameid-format:entity

    This specifies the name identifier format that the Identity Server wants to receive in the subject of an assertion from a particular identity provider. The following is the default format used by the identity provider.

    • urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
  • Select Use fully qualified username in the NameID if that feature is required. A fully qualified username is basically the user name with the user store domain. In short, the username must be in the following format: {user store domain}{user name}

  • Select Enable Response Signing to sign the SAML2 Responses returned after the authentication process.
  • Select Enable Assertion Signing to sign the SAML2 Assertions returned after the authentication. SAML2 relying party components expect these assertions to be signed by the Identity Server.

  • Select Enable Signature Validation in Authentication Requests and Logout Requests if you need this functionality configured. This specifies whether the identity provider must validate the signature of the SAML2 authentication request and the SAML2 logout request that are sent by the service provider. 

  • Enable Assertion Encryption, if you wish to encrypt the assertion.
  • Select the Certificate Alias from the dropdown. This is used to validate the signature of SAML2 requests and is used to generate encryption. Basically the service provider’s certificate must be selected here. Note that this can also be the Identity Server tenant's public certificate in a scenario where you are doing a tenant specific configuration.
  • Select Enable Single Logout so that all sessions are terminated once the user signs out from one server. If single logout is enabled, the identity provider sends logout requests to all service providers. Basically, the identity provider acts according to the single logout profile. If the service provider supports a different URL for logout, you can enter a Custom Logout URL for logging out. If you do not specify this URL, the identity provider uses the Assertion Consumer Service (ACS) URL. 

  • Select Enable Attribute Profile to enable this and add a claim by entering the claim link and clicking the Add Claim button. The Identity Server provides support for a basic attribute profile where the identity provider can include the user’s attributes in the SAML Assertions as part of the attribute statement. Once you select the checkbox to Include Attributes in the Response Always, the identity provider always includes the attribute values related to the selected claims in the SAML attribute statement. 

  • Select Enable Audience Restriction to restrict the audience. You may add audience members using the Audience text box and clicking the Add Audience button.

  • Select the Enable IdP Initiated SSO checkbox to enable this functionality. When this is enabled, the service provider is not required to send the SAML2 request. 

Additional configurations

If you need to sign the SAML response using an authenticated user's tenant keystore, please add the following configuration. (By default, the response is signed using the certificate that belongs to the tenant where the service provider is registered). This property must be added if the SAML authenticator version in the WSO2 Carbon products that you are using is 4.2.2 or higher (org.wso2.carbon.identity.authenticator.saml2.sso_4.2.2.jar).

Add the <UseAuthenticatedUserDomainCrypto> property available in the <IS_HOME>/repository/conf/identity.xml file as shown below.

<SSOService>
...
	<UseAuthenticatedUserDomainCrypto>true<UseAuthenticatedUserDomainCrypto>
</SSOService>

Configuring OAuth/OpenID Connect

OAuth provides a method for clients to access server resources on behalf of a resource owner (such as a different client or an end-user). It also provides a process for end-users to authorize third-party access to their server resources without sharing their credentials (typically, a username and password pair), using user-agent redirections.

OpenID Connect is a simple identity layer on top of the OAuth 2.0 protocol. It allows Clients to verify the identity of the End-User based on the authentication performed by an Authorization Server, as well as to obtain basic profile information about the End-User in an interoperable and REST-like manner.

OpenID Connect allows clients of all types, including Web-based, mobile, and JavaScript clients, to request and receive information about authenticated sessions and end-users. The specification suite is extensible, allowing participants to use optional features such as encryption of identity data, discovery of OpenID Providers, and session management, when it makes sense for them.

To enable OAuth support for your client application, you must first register your application by providing an application name and a callback URL. Follow the instructions below to add a new application.

  1. Expand the OAuth/OpenID Connect Configuration and click Configure.
  2. Fill in the form that appears. For the Allowed Grant Types you can disable the ones you do not require or wish to block.
  3. Click Add. The following information is added for your service provider.

    • OAuth Client Key - This is the client key of the service provider, which will be checked for authentication by the Identity Server before providing the access token.
    • OAuth Client Secret - This is the client secret of the service provider, which will be checked for authentication by the Identity Server before providing the access token. Click the Show button to view the exact value of this.

When filling out the New Application form, the following should be taken into consideration.

  • Selecting OAuth Version as 1.0a removes all the configurable Allowed Grant Types. This is because this version of OAuth does not support grant types.
  • The Callback Url is the exact location in the service provider's application where an access token would be sent. This is a required field and important to configure as it is imperative that the service provider receives the access token. This is necessary for security purposes to ensure that the token is not compromised.
  • The following are the grant types that are used to get the access token.
    • Code - Entering the user name and password required at the service provider will result in a code being generated. This code can be used to obtain the access token.
    • Implicit - This is similar to the code grant type, but instead of generating a code, this directly provides the access token.
    • Password - This authenticates the user using the password provided and the access token is provided.
    • Client Credential - This is the grant type for the client key and client secret. If these two items are provided correctly by the service provider, the access token is sent.
    • Refresh Token - This will enable the user to obtain an access token by using the refresh token once the originally provided access token is used up.
    • SAML - This uses SAML as the grant type to obtain the access token.
    • IWA-NTLM - This is similar to the password grant type, but it is specific to Microsoft Windows users.

Configuring WS-Trust Security Token Service

This requires registration of relying party endpoint addresses and their corresponding public certificates. In this scenario, STS generates a symmetric key and encrypts it with the public key of the relying party. This is included in the subject confirmation section of the SAML token, which is validated at the relying party end.

Follow the instructions below to configure STS for obtaining tokens.

  1. Expand the WS-Trust Security Token Service Configuration and click Configure.
  2. Specify the required information in the form that appears.
    • Endpoint Address - Relying party service endpoint where the token is being delivered to. This is a required field.
    • Certificate Alias - Corresponding public certificate for the service endpoint.
  3. Click Apply. The following information is added to your service provider.
     

Configuring WS-Federation (Passive) or OpenID

  1. Expand the WS-Federation (Passive) Configuration or OpenID Configuration.
  2. Enter the identifier for the Passive STS Realm and the OpenID Realm. These identifiers need to be specified as identification when the service provider reaches out to the Identity Server. For WS-Federation (Passive), you can also specify the endpoint of the realm in Passive STS WReply URL.

    Tip: When WS-Federation Passive request comes from a relying party, it checks whether there is a Passive STS WReply URL defined for the service provider. If there is a Passive STS WReply URL defined, it sets the replyTo URL as the one given in service provider configurations (this may override the replyTo parameter given in the request). If there is no Passive STS WReply URL defined in the service provider configuration, the replyTo URL given in the request is used. If there is no replyTo URL given in the request, wtrealm is used for as the replyTo URL.

Configuring Kerberos KDC

Kerberos is an authentication protocol which can be used to secure communications in web services. Kerberos enables you to exchange user credentials securely. Thus, it also provides mutual authentication in which the server can also authenticate itself to the client.

The Kerberos protocol uses a trusted third party called “Key Distribution Center” (KDC). KDC consists of two logical parts. They are:

  • Authentication Server
  • Ticket Granting Server

The actual user credentials are stored within the Authentication Server. The communicating parties will retrieve a Kerberos ticket from the Ticket Granting Server. TGS validates the ticket-requesting users' credentials with the Authentication Server.

Kerberos Security within WSO2 Identity Server

WSO2 Identity Server uses an ApacheDS-based LDAP server user store. It also has an ApacheDS based on KDC implementation. Users can use WSO2 Identity Server as a KDC and implement Kerberos security to secure communications between services and clients.
Enable KDC within WSO2 Identity Server.

To use KDC in Identity Server, you need to use the embedded LDAP which ships with WSO2 Identity Server. Thus, by default, the KDC server is disabled. To enable the KDC server, go to the Identity Server home directory and navigate to the <PRODUCT_HOME>/repository/conf folder. There you will find a file named embedded-ldap.xml. Open embedded-ldap.xml and find the <KDCServer/> XML tag. You will configure the XML element named enabled. Set its value to true. After modifying it, the XML configuration should look like this:

<KDCServer>
<Property name="name">defaultKDC</Property>
<Property name="enabled">true</Property>
<Property name="protocol">UDP</Property>
<Property name="host">localhost</Property>
<Property name="port">${Ports.EmbeddedLDAP.KDCServerPort}</Property>
<Property name="maximumTicketLifeTime">8640000</Property>
<Property name="maximumRenewableLifeTime">604800000</Property>
<Property name="preAuthenticationTimeStampEnabled">true</Property>
</KDCServer>
Service Principals

The KDC Server issues tickets to access a particular service. Thus, each type of service is associated with a particular service name. In the case of Kerbero, we call the service name “Service Principal Name” (SPN). Before we assign an SPN to a service, we need to define the “Service Principal Name” in KDC.

Users can use this screen to perform operations on service principals.

  1. Expand the Inbound Authentication Configuration section and click Configure under Kerberos KDC.
  2. Specify the required information on the "Service Principal Management" page.
    • Service Principal Name – Name of the service principal. This usually takes following format: <Service Name>/<Host where service is running>. This field is mandatory.
    • Password – The password given to the service principal. You would use this password in the appropriate service's rampart configuration. Thus, the appropriate service will provide a password, given in rampart configuration, to KDC when it needs to authenticate itself to KDC. This field is mandatory.
    • Re-Type Password – Re-type password provided in the "Password" section to make sure the given password is accurate. This field is mandatory.
    • Description – Brief description of the service principal. This field is not mandatory.
  3. Click on the Finish button.
  4. Your service principal is added to a list. You can change the password or delete the service principal using the associated links.
  • No labels