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

Unable to Create A New User When Password is Validated: config.saml_default_update_resource_hook not working #177

Open
mcollie1 opened this issue Aug 29, 2020 · 1 comment

Comments

@mcollie1
Copy link

My application supports signing in with username/password and SSO. Logging in with an existing user works as expected, but when adding a new user via the IDP interface, my application throws ActiveRecord::RecordInvalid (Validation failed: Password can't be blank)

I read your suggestion to use config.saml_default_update_resource_hook after config.saml_create_user, but that doesn't work as the devise validation, on create new user, happens before the proc is called, triggering the error.

Any suggestion on how to proceed?

@adamstegman
Copy link
Collaborator

In default operation, the new user is saved using the saml_update_resource_hook:

if Devise.saml_update_user || (resource.new_record? && Devise.saml_create_user)
begin
Devise.saml_update_resource_hook.call(resource, decorated_response, auth_value)
.

Can I see your devise SAML configuration from config/initializers/devise.rb, with any credentials or secrets removed?

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

2 participants