OneLogin
Single sign-on with OneLogin
This tutorial will explain configuring OneLogin for single sign-on to Pritunl. Users will authenticate through OneLogin when downloading VPN profiles. After a user has downloaded a VPN profile the Pritunl server will use the OneLogin API to verify that the user still exists and is enabled before each VPN connection.
Create Pritunl App on OneLogin
In the OneLogin admin interface select New App and search for SAML Test Connector (IdP w/ attr w/ sign response). Then change the name to Pritunl
and download the OneLogin Pritunl logos pritunl.com/img/pritunl_onelogin.png and pritunl.com/img/pritunl_onelogin_square.png. Then upload both logos and click Save.
On the next page set the RelayState to the address your users would use to access the Pritunl server such as https://vpn.example.com
. Set the Audience to pritunl
. Then enter https://auth.pritunl.com/v1/callback/saml
as the Recipient, ACS (Consumer) URL Validator and ACS (Consumer) URL. Once done click Save and click the Parameters tab.
On the parameters tab click Add parameter and set the Field name to username
and select Include in SAML assertion then click Save. Then click on the parameter and set the Value to Username
. Do this again using email
as the name and Email
as the value.
Setting User Organization
By default all OneLogin users will be added to the default organization set in the Pritunl settings. Users can be added to a specific organization using the org
attribute. This attribute can be mapped to a value such as Department
. The value of the attribute must exactly match the name of an existing organization on the Pritunl server. If a value is given for an organization that does not exist the user will be added to the default organization. OneLogin provides several mapped values including macros for more customized values. Refer to the OneLogin documentation for setting the value of the org
attribute to best match Pritunl organizations.
Create API Token
Pritunl will require an API token to validate if a user exists and is enabled before allowing a VPN connection. To create a token click Settings then API and New Credential. Name the token Pritunl
then select Manage All and save the token for later.
Add Users to Pritunl App
After the OneLogin app has been created you will need to add users to the Pritunl app before they are able to use it. This can be done in the Users tab on the Pritunl app settings on OneLogin.
OneLogin App Id
Next get the OneLogin app ID from the url in the OneLogin application settings. The ID is the last number component of the URL. For example the ID for this url https://pritunl.onelogin.com/apps/581429/edit
is 581429
. This ID will be needed in the next step.
Configure Pritunl
Once the OneLogin app has been configured click on the app then click Sign On and View Setup Instructions. Then open the Pritunl settings and set Single Sign-On to OneLogin and set the Single Sign-On Organization. This organization will be the default organization OneLogin users are added to. Set the OneLogin App ID to the ID from the previous step. Then copy the SAML 2.0 Endpoint (HTTP) to SAML Sign-On URL. Then Issuer URL to SAML Issuer URL. Then X.509 Certificate to SAML Certificate. Use the API token from earlier to fill in OneLogin API Client ID and OneLogin API Client Secret.
OneLogin API Region
When using OneLogin from the EU the command sudo pritunl set app.sso_onelogin_region '"eu"'
must be run on one Pritunl host.
Updated almost 4 years ago