chrodriguez / redmine_omniauth_saml

Plugins that adds SAML authentication support for "Redmine"
GNU General Public License v2.0
38 stars 57 forks source link

WARNING: Can't mass-assign protected attributes for User: login #23

Closed acosonic closed 7 years ago

acosonic commented 7 years ago

Trying to get oneLogin to work, and keep getting

WARNING: Can't mass-assign protected attributes for User: login
        lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Completed 422 Unprocessable Entity in 11ms (ActiveRecord: 1.6ms)

ActiveRecord::RecordInvalid (Validation failed: Login cannot be blank):
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
acosonic commented 7 years ago

That's for new account creation, apparently in user patch

this line user = new user_attributes

tries to assign multiple protected attributes, including mail, and login seems blank.

I'm not sure mail can even be assigned that way.

acosonic commented 7 years ago

I actually have fixed this in my fork, but made it onelogin specific...

chrodriguez commented 7 years ago

I've seen your PR. If you fix the comments I've made, I'll merge it

Thanks!!