Skip to content

Commit ec00fd7

Browse files
author
John Pinto
committed
To test with use wit SimppleSAMLPHP as an Idp
1 parent e3be5dc commit ec00fd7

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,4 +347,7 @@ group :development do
347347

348348
# TomDoc for YARD (http://rubyworks.github.com/yard-tomdoc)
349349
gem 'yard-tomdoc'
350+
351+
# IDP testing
352+
gem 'rack-cors'
350353
end

config/initializers/cors.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Be sure to restart your server when you modify this file.
2+
3+
# Avoid CORS issues when API is called from the frontend app.
4+
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.
5+
6+
# Read more: https://github.com/cyu/rack-cors
7+
8+
Rails.application.config.middleware.insert_before 0, Rack::Cors do
9+
allow do
10+
origins 'localhost:8080'
11+
12+
resource '*',
13+
headers: :any,
14+
methods: %i[get post put patch delete options head],
15+
credentials: true
16+
end
17+
end

config/initializers/devise.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259

260260
# Any entries here MUST match a corresponding entry in the identifier_schemes table as
261261
# well as an identifier_schemes.schemes section in each locale file!
262-
OmniAuth.config.full_host = 'https://my_service.hostname'
262+
OmniAuth.config.full_host = 'http://localhost:3000'
263263
OmniAuth.config.allowed_request_methods = [:post]
264264

265265
config.omniauth :orcid,
@@ -270,13 +270,14 @@
270270

271271
config.omniauth :shibboleth,
272272
{
273-
# debug: true,
274-
# uid_field: "HTTP_REMOTE_USER",
275-
# shib_application_id_field: "HTTP_SHIB_APPLICATION_ID",
276-
# shib_session_id_field: "HTTP_SHIB_SESSION_ID",
273+
uid_field: "HTTP_REMOTE_USER",
274+
shib_application_id_field: "HTTP_SHIB_APPLICATION_ID",
275+
shib_session_id_field: "HTTP_SHIB_SESSION_ID",
277276
fields: [],
278277
info_fields: {
279-
# affiliation: "HTTP_AFFILIATION",
278+
email: "HTTP_MAIL",
279+
name: "HTTP_DISPLAYNAME"
280+
# Add other attributes you need
280281
},
281282
extra_fields: []
282283
}

0 commit comments

Comments
 (0)