Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of SAML config available? #9

Open
jackiejohnston opened this issue Apr 19, 2019 · 3 comments
Open

Example of SAML config available? #9

jackiejohnston opened this issue Apr 19, 2019 · 3 comments

Comments

@jackiejohnston
Copy link

I'm trying to use this for an IdP and would like to see an example of what would go in the SAML config file referenced in your SamlIdpController example ('saml.yml'). Is there a repo for an example IdP using this gem? Also, is it possible to return more than just the ID of the user? I'd like to be able to return the user's first and last name and email address as well.

@td512
Copy link

td512 commented Nov 8, 2019

Hey @jackiejohnston, thought you might like to know I built an IdP with this gem, you can find it here. You're looking for app/controllers/saml_controller.rb

If you're going to use my implementation you need to change a bit and generate a new keypair. The additional things are up to you

@bmalets
Copy link

bmalets commented Dec 23, 2019

@jackiejohnston saml.yml should have this format:

entity_id:
service_provider: # path to service provider metadata.xml
encryption:
  certificate:
  private_key:
  algorithm:

Location of this YML file should be current: config/saml.yml
And you have to replace method:

  def self.saml_config
    @config ||= YAML.load(File.read('saml.yml'))
  end

with:

  def self.saml_config
    @config ||= YAML.load(File.read(Rails.root.join('config/saml.yml')))
  end

BTW besides absent saml.yml file I also found a magic @current_user variable in the example of SamlIdpController.

@jackiejohnston
Copy link
Author

@td512 @bmalets Thank you both! I actually ended up using the saml_idp gem instead, but I'm sure others will benefit from your replies!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants