• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tulibraries / tul_cob / b4e13125-3ed4-4c2a-ac8e-b545381656c9

06 Sep 2023 01:26PM UTC coverage: 84.602% (-0.2%) from 84.83%
b4e13125-3ed4-4c2a-ac8e-b545381656c9

push

circleci

web-flow
Update rails for security fix (#3932)

* Update rails for security fix

* Add Gemfile.lock

2967 of 3507 relevant lines covered (84.6%)

54.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

64.29
/app/controllers/users/omniauth_callbacks_controller.rb
1
# frozen_string_literal: true
2

3
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
1✔
4
  protect_from_forgery with: :exception, except: :saml
1✔
5
  skip_before_action :verify_authenticity_token, only: [:alma, :saml]
1✔
6

7
  def alma
1✔
8
    # You need to implement the method below in your model (e.g. app/models/user.rb)
9
    @user = User.from_omniauth(request.env["omniauth.auth"])
×
10
    set_flash_message(:success, :success, kind: "Alma") if is_navigational_format?
×
11
    sign_in_and_redirect @user, event: :authentication #this will throw if @user is not activated
×
12
  end
13

14
  def shibboleth
1✔
15
    @user = User.from_omniauth(request.env["omniauth.auth"])
×
16
    sign_in(:user, @user)
×
17
    session[:alma_auth_type] = "sso"
×
18
    session[:alma_sso_user] = @user.uid
×
19
    session[:alma_sso_token] = SecureRandom.hex(10)
×
20
    set_flash_message(:success, :success, kind: "Temple Single Sign On") if is_navigational_format?
×
21
    redirect_to params[:target] || helpers.users_account_path
×
22
  end
23

24
  def saml
1✔
25
    auth = request.env["omniauth.auth"]
2✔
26
    omniauth_params = request.env["omniauth.params"]
2✔
27

28
    auth.uid = auth.extra.raw_info["urn:oid:2.16.840.1.113730.3.1.3"]
2✔
29
    @user = User.from_omniauth(auth)
2✔
30
    sign_in(:user, @user)
2✔
31

32
    session[:alma_auth_type] = "sso"
2✔
33
    session[:alma_sso_user] = @user.uid
2✔
34
    session[:alma_sso_token] = SecureRandom.hex(10)
2✔
35
    set_flash_message(:success, :success, kind: "Temple Single Sign On") if is_navigational_format?
2✔
36
    redirect_to omniauth_params["target"] || helpers.users_account_path
2✔
37
  end
38

39
  def failure
1✔
40
    redirect_to root_path
1✔
41
  end
42
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc