Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configure SAML Authentication (CLI Procedure)

In this configuration, you'll learn to setup Security Assertion Markup Language (SAML) based user authentication in Juniper Secure Connect.

Juniper Secure Connect supports remote user authentication using SAML v2 (SAML 2.0). In this configuration example, the SRX Series Firewall servers as the SAML service provider and authenticates the Juniper Secure Connect users using SAML IdP.

Tip:
Table 1: Readability Score and Time Estimates

Reading Time

Less than an hour

Configuration Time

Less than an hour

Example Prerequisites

Ensure you meet the following prerequisites:

  • Understand the following main components in the example.

    • An active identity provider (IdP) user account. Okta and Microsoft Azure are examples of IdPs.

      In this example, we've used Okta as the IdP. For IdP settings, see Functional Overview. The step-by-step SAML 2.0 IdP configuration is out-of-scope of this documentation. The settings depend on your agreement with the IdP.

    • An SRX Series Firewall that acts a service provider (SP).

      This topic covers step-by-step configuration of SRX Series Firewall for SAML-based user authentication. See Functional Overview and Step-By-Step Configuration on vSRX

    • Juniper Secure Connect application for Windows that supports SAML-based user authentication.

      See Juniper Secure Connect for Windows.

  • Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.

  • Ensure that you've an account with your IdP before configuring the service provider. Confirm you've configured all necessary settings in your IdP application. Take a note of the following items on your IdP account:

    • Note the IdP entity ID.

    • Note the single sign-on (SSO) URL.

    • Note the single logout URL.

    • Download the signing certificate from the IdP and load it to the firewall.

      The example includes EXAMPLE-CA as the ca-profile-name.

    • Ensure you've created users in your IdP application.

  • Ensure the firewall, which is the service provider, can reach the IdP SSO and single logout URLs using the Internet-facing interface.

  • Ensure you've created the firewall (server-side) self-signed certificates for web-management and SSL profile. You can also use CA-signed certificates.

  • Ensure you've CA-signed certificate for IKE.

Table 2: Hardware and Software Requirements

Hardware requirements

  • One SRX Series Firewall that supports the feature.

  • Windows laptop with the latest Juniper Secure Connect application installed.

Software requirements

  • Junos OS Release that supports the feature with junos-ike package to run VPN service with the iked process.

  • IdP details mentioned in the Example Prerequisites. In this example, we've used Okta as the IdP.

Before You Begin

Table 3: Resources, and Additional Information

Understand SAML for Juniper Secure Connect

Know more

Learn about Junos configuration statements and CLI commands for SAML.

See saml, authentication-order (access-profile), saml (Access Profile), saml-options, show network-access aaa saml assertion-cache, show network-access aaa statistics, request network-access aaa saml load-idp-metadata, request network-access aaa saml export-sp-metadata, clear network-access aaa saml assertion-cache, clear network-access aaa saml idp-metadata, and clear network-access aaa statistics

Functional Overview

Table 4: Functional Overview

Functional Component

Details

Certificates

Self-signed certificate or CA-signed certificate for web-management

jsc-web is the PKI local certificate for web-authentication.

Self-signed certificate or CA-signed certificate for SSL profile

jsc is the server-side certificate for SSL profile.

CA-signed certificate for IKE

IKE-CERT is the signed-certificate for IKE. Use the CA certificate in the client laptop where you've installed your Juniper Secure Connect application.

Signed-certificate from IdP

SAML IdP certificate, EXAMPLE-CA is the signing certificate downloaded from IdP and copied to the firewall.

IKE

IKE proposal

JSC-IKE-PRO is the IKEv2 proposal that defines the algorithms and keys used to establish the secure IKE connection with Juniper Secure Connect application.

IKE policy

JSC-IKE-POL is the IKEv2 policy that defines the IKE proposal to be used during IKE negotiation.

IKE gateway

JSC-GW is the IKEv2 gateway that uses the IKE policy. In Juniper Secure Connect, associate the IKE gateway with the access profile and the TCP encapsulation profile. We've used example.com as the IKE gateway domain name

IPsec

IPsec proposal

JSC-IPSEC-PRO is the IPsec proposal that defines the IPsec protocol and algorithms used to establish the secure IKE connection with Juniper Secure Connect application.

IPsec policy

JSC-IPSEC-POL is the IPsec policy that defines the IPsec proposal to be used during IPsec negotiation.

SAML Access Profile

SAML Authentication Order

The access profile JSC-ACCESS defines saml as the authentication method. It contains the address pool details for the Juniper Secure Connect and the associated SAML service provider name and IdP domain details.

SAML IdP

SAML IdP name

example-idp is the name of the IdP used in this example. We've used example.org as the IdP domain name.

SAML IdP Entity ID

http://www.example.org/abcd1234 is the unique entity which is a URI that identifies the IdP. The metadata XML file has the IdP entity-id information. Use it in the entity-id option at [edit access saml identity-provider name settings] hierarchy level.

SAML login URL

https://5075942.example.org/app/5075942_srx1examplenet_1/abcd1234/sso/saml is the single-signon-url on available on the IdP. Use it in the single-signon-url-name option at [edit access saml identity-provider name settings signle-signon-url signle-signon-url] hierarchy level.

SAML logout URL

https://5075942.example.org is the single-logout-url on available on the IdP. Use it in the single-logout-url-name option at [edit access saml identity-provider name settings single-logout-url] hierarchy level.

SAML IdP certificate

EXAMPLE-CA is the signing certificate available on the IdP. The SAML service provider uses this IdP certificate validating its users. Use it in the idp-certificate-name option at [edit access saml identity-provider name settings idp-certificate] hierarchy level.

SAML user attributes

user1, who is the Principal, requests access. SAML user attributes are name-value pairs that are IdP attributes. These attributes include user information such as firstname, lastname, or email configured on the IdP. The IdP sends this information to the service provider through the SAML assertion.

During the firewall configuration, specify whether an attribute related to the Principal is mandatory or optional.

SAML service provider

SAML service provider name

vsrx-jsc is the name of the service provider used in this example. We've used example.net as the service provider domain name for SAML.

SAML service provider Entity ID

https://srx1.example.net is the unique entity which is a URI that identifies the service provider. Use it in the entity-id option at [edit access saml service-provider name] hierarchy level.

Tip: SAML domain names are case-sensitive. Example.net is different from example.net in SAML.

Remote Access

Profile

jsc-saml is the remote access VPN profile with IPsec VPN, user access profile, and Secure Connect client configuration settings.

SSL

Termination profile

JSC-SSL-PRO is the SSL termination profile for the remote access IPsec traffic encapsulation into a TLS connection.

Security Zones

trust

Network segment facing the corporate resources such as the server.

untrust

Network segment facing the Internet. Note that IdP is reachable through this segment.

VPN

Network segment with the secure tunnel interface st0.0.

Security Policy

Allows you to select the type of data traffic.

  • JSC-ALLOW-OUT—Permits traffic from the trust zone to the vpn zone, where the match criteria is:

    • source-address: any

    • destination-address: any

    • application: any

  • JSC-ALLOW-IN—Permits traffic from the vpn zone to the trust zone, where the match criteria is:

    • source-address: any

    • destination-address: any

    • application: any

  • default-permit—Permits traffic from the trust zone to the trust zone, where the match criteria is:

    • source-address: any

    • destination-address: any

    • application: any

  • default-permit—Permits traffic from the trust zone to the untrust zone, where the match criteria is:

    • source-address: any

    • destination-address: any

    • application: any

Source NAT

Source NAT to allow traffic from the VPN client to reach the internal server.

Topology Overview

In this example, the Juniper Secure Connect client initiates remote access VPN connection establishment with the firewall, vSRX. The firewall sends SAML authentication request to Juniper Secure Connect which checks with the IdP for the user authentication. Once authentication completes, the firewall confirms the SAML assertion, and establishes remote access VPN tunnel.

Table 5: Topology Overview

Hostname

Role

Function

vsrx

  • Remote access VPN server

  • SAML service provider

  • In Juniper Secure Connect, the firewall establishes the remote access VPN tunnels.

  • In Juniper Secure Connect SAML-based user authentication, the firewall functions as the SAML service provider delivering remote access VPN service. This service provider relies on the IdP’s assertions to grant user access.

Client

Remote access VPN client

In Juniper Secure Connect, a laptop or computer using the Juniper Secure Connect application initiates a VPN connection with the firewalls.

IdP

SAML IdP

In Juniper Secure Connect, the IdP authenticates users and provides identity assertions to the service provider. The IdP generates an authentication assertion to confirm user authentication. Okta serves as the IdP in this example.

Server

Server in the trust zone

The Juniper Secure Connect client tries to access the internal corporate server.

Topology Illustration

Figure 1: SAML-Based User Authentication in Juniper Secure Connect SAML-Based User Authentication in Juniper Secure Connect

Step-By-Step Configuration on vSRX

Note:

For complete sample configurations on the DUT, see:

This configuration is applicable for only vSRX. You must make the appropriate device-specific configuration changes.

  1. Configure interfaces.
  2. Configure security zones.
  3. Configure security policies.
  4. Configure source NAT.
  5. Configure certificates.
  6. Configure web-management.
  7. Configure IKE proposal.
  8. Configure IKE policy.
  9. Configure IKE gateway.
    1. Configure IKE gateway options.
    2. Configure external interface IP address for the clients to connect. You must enter this IP address (https://172.16.1.254/<profile>) for the Gateway Address field in the Juniper Secure Connect application.
    3. Configure dead peer detection (DPD).
    4. Associate the gateway with the access profile and the TCP encapsulation profile.
  10. Configure IPsec proposal.
  11. Configure IPsec policy.
  12. Configure IPsec VPN parameters and traffic selectors.
  13. Configure remote access settings.
    1. Configure remote access profile.
    2. Configure remote access client settings.
  14. Configure the firewall as the local gateway for remote access.
    1. Set SAML as the authentication method for the access profile.
    2. Specify SAML settings for the access profile.
    3. Associate the network address pool with the access profile.Configure the address pool for assigning dynamic IPs the clients.
    4. Configure firewall authentication.
    5. Configure SSL termination profile for the firewall to act as an SSL proxy server, and terminate the SSL session from the client. The server certificate is a local certificate identifier. Server certificates are used to authenticate the identity of a server.
    6. Configure SSL VPN profile.
  15. Configure the SAML access parameters such as IdP and SP settings.

Verification

This section provides a list of show commands that you can use to verify the feature in this example. .

Verify SAML-Based User Authentication in Juniper Secure Connect Application

Purpose

Connect Juniper Secure Connect application for remote access VPN using SAMl-based user authentication.

Action

Perform the following steps on your client:

  1. Place the CA certificate in the client laptop at C:\ProgramData\Juniper\SecureConnect\cacerts.

  2. Enter the Connection Profile as https://172.16.1.254/jsc-saml or https://srx1.juniper.net/jsc-saml. Then click the Connection toggle button to establish the VPN connection.

  3. After the system downloads the configuration, you see a window, User ID for SAML authentiation, that prompts you for your SAML user ID. Enter your SAML user ID in the User ID field as user1@srx1.example.net.

  4. The system redirects you to the IdP SSO URL in your default browser. Enter the username user1@srx1.example.net along with the correct password.

  5. When you successfully complete the user authentication, accept the browser pop-up to launch the Juniper Secure Connect application.

  6. Close the browser while the IKE connection runs in the background.

  7. Observe that the Juniper Secure Connect application establishes the remote access VPN connection.

Meaning

The user, user1@srx1.example.net is authenticated with SAML-based user autehntication method and the remote access VPN connection established. Notice that the username is in the email format defined in the IdP's mandatory attribute-mapping.

Verify SAML Assertion Cache Entries

Purpose

Run the command to display SAML assertion cache entries.

Action

From operational mode, run the command show network-access aaa saml assertion-cache on vSRX.

Meaning

Shows SAML authentication assertions cache information with the domain name configured in the access profile IdP settings and the SAML authenticated username.

Verify Subscriber-Specific AAA Statistics

Purpose

Run the command to display subscriber username.

Action

From operational mode, run the command show network-access aaa subscribers on vSRX.

Meaning

Displays information about active subscriber sessions.

Verify SAML Authentication Statistics

Purpose

Run the command to display SAML authentication statistics.

Action

From operational mode, run the command show network-access aaa statistics saml on vSRX.

Meaning

Displays SAML authentication statistics.

Verify IKE SA

Purpose

Run the command to display information about IKE security associations (SA).

Action

From operational mode, run the command show security ike security-associations on vSRX.

Meaning

Shows the firewall's IKE mode as IKEv2 and has SA with 172.17.1.1 which is the Juniper Secure Connect client.

Verify IPsec SA

Purpose

Run the command to display information about IPsec SA.

Action

From operational mode, run the command show security ipsec security-associations on vSRX.

Meaning

Shows that the firewall has one active IPsec tunnel SA with 172.17.1.1 which is the Juniper Secure Connect client.

Verify IKE Active Peer

Purpose

Run the command to display the connected IKE peers.

Action

From operational mode, run the command show security ike active-peer on vSRX.

Meaning

Shows that the firewall has one active IKE peer 172.17.1.1 which is the Juniper Secure Connect client. The firewall also displays the peer IKE ID and the authenticated remote username and IP address assigned to the user.

Appendix 1: Troubleshoot Juniper Secure Connect

If you encounter any issue with SAML-based user authentication, follow these steps to troubleshoot the problem:

  1. The feature works with the iked process. Ensure you install the junos-ike package by using the command request system software add optional://junos-ike.tgz.
  2. Enable traceoptions for PKI, IKE, IPsec, and remote access options. For example, run the command set security pki traceoptions file pki.log to enable traceoptions on PKI. Check the syslogs and trace logs.
  3. Check whether the SAML assertion cache is disabled. If the SAML assertion cache is disabled, we recommend enabling it to cache SAML assertions from the IdP. See saml-options.
  4. Ensure that the assertion cache contains a valid entry for the user. The assertion cache must include a valid user entry to support SAML-based user authentication. If the cache does not have a valid entry, perform a manual disconnect and reconnect of the VPN connection in the Juniper Secure Connect application. This action prompts the application to authenticate the user again and repopulate the assertion cache. See show network-access aaa saml assertion-cache.
  5. If the syslog reports AUTHD_SAML_AUTH_FAILED because of an assertion wait timeout, extend the assertion timeout using the command set access saml service-provider yoursaml assertion-waittime waittime.
  6. To reload IdP metadata, see request network-access aaa saml load-idp-metadata.
  7. To export service provider metadata, see request network-access aaa saml export-sp-metadata.
  8. If you notice that the IKE session times out, extend the session using the command set security ike session half-open timeout timeout.

Appendix 2: Set Commands on vSRX

Set command output on vSRX.

Appendix 3: Show Configuration Output on vSRX

Show command output on vSRX.

From configuration mode, confirm your configuration by entering the following commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.