Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

vmware-archive/pivotal_auth

Repository files navigation

PivotalAuth

Setup

To install, add these two lines to your Gemfile:

gem "pivotal_auth", github: "pivotal/pivotal_auth"
gem "okta_saml", github: "pivotal/okta_saml", branch: "dev"

Add this line in your routes:

mount PivotalAuth::Engine, at: '/'

Make sure you also have a root route defined. This is where users will be redirected to after login, unless they have previously visited a page that requires authentication.

Run these lines:

bundle
rails g pivotal_auth:init

Ignore the "Missing okta_saml.yml file in Rails.root/config" warning.

Environment Variables and Okta Setup

The gem requires two env variables: OKTA_LOGIN_URL and OKTA_CERT_FINGERPRINT. These are specific to the Okta app you are authenticating against.

To get these values, follow the instructions under "Okta Configuration" and "Configuration". Step 1 of the "Configuration" instructions refers to OKTA_LOGIN_URL. Step 2 of the instructions refers to OKTA_CERT_FINGERPRINT.

Routes

  • Login: /login
  • Logout: /logout

Useful Controller/View Helper Methods

  • current_user_email - Returns the email of the currently logged in user.
  • user_signed_in? - Returns if a user is signed in
  • authenticate_user! - A before filter that will redirect to '/login' if no user is signed in. It will also set a redirect url to the current path.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published