Commit 47fe3559 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Use the full principal name as omniauth UID

parent 190a9450
...@@ -10,7 +10,7 @@ module OmniAuth ...@@ -10,7 +10,7 @@ module OmniAuth
option :name, 'kerberos_spnego' option :name, 'kerberos_spnego'
uid { username } uid { principal_name }
info do info do
{ username: username, email: email } { username: username, email: email }
......
...@@ -9,6 +9,11 @@ describe OmniAuth::Strategies::KerberosSpnego do ...@@ -9,6 +9,11 @@ describe OmniAuth::Strategies::KerberosSpnego do
allow(subject).to receive(:session).and_return(session) allow(subject).to receive(:session).and_return(session)
end end
it 'uses the principal name as the "uid"' do
session[:kerberos_spnego_principal_name] = 'Janedoe@FOOBAR.COM'
expect(subject.uid).to eq('Janedoe@FOOBAR.COM')
end
it 'extracts the username' do it 'extracts the username' do
session[:kerberos_spnego_principal_name] = 'Janedoe@FOOBAR.COM' session[:kerberos_spnego_principal_name] = 'Janedoe@FOOBAR.COM'
expect(subject.username).to eq('Janedoe') expect(subject.username).to eq('Janedoe')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment