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

SAML Attributes not passing #278

Closed
dejonestheadmin opened this issue Apr 19, 2024 · 2 comments
Closed

SAML Attributes not passing #278

dejonestheadmin opened this issue Apr 19, 2024 · 2 comments
Labels
question Further information is requested

Comments

@dejonestheadmin
Copy link

Hello I am a system admin and I'm very green/new to the scene of SAML and Django. Long story short I have an app "mailman" im trying to implement SSO on now I got it setup and working but i noticed that when a new user is created the only info that gets created in the user profile is username and the user shows up as the email for example user@example.com it doesn't fill out the first name last name or email. The other strange thing about this is that in the Attributes Map I put for example
'email': 'urn:oid:12345.4.555.44432' in email one for username etc. Well i tried logging in then i get an error saying that its missing user_id I cannot for the life of me figure out whats wrong. so i ended up plugging in the oid # for email into username as well and it worked but with the results i explained ealier i attempted the same thing but with email commented out and it still worked.. so i dont understand honestly whats wrong.. I tried a workaround with the hooks trying to extract.. the user_id and Im just not versed enough in this to really make heads or tails of whats going on. If anyone could help that would be greatly greatly appreciated. I dont know if this is the correct forum to even put this message in if not then by all means remove my post as i understand this might not be the exact place for this type of discussion thank you for you time and consideration

@dejonestheadmin
Copy link
Author

I keep getting the error Missing user_id but the attribute mapping is correct Ive looked it over a few times

@dejonestheadmin
Copy link
Author

Fixed this issue with the following code i found from another issue posted in here

def post_create_user(user_dict, *args, **kwargs):
user_model = get_user_model()
user_id = user_dict.get(user_model.USERNAME_FIELD)
user = user_model.objects.get(username=user_id)
user.email = user_id
user.username = user_id.split('@')[0]
user.save()

now the challenge is that when a usr exist already its trying to create again rather than seeing the user exist then allowing login 

@mostafa mostafa added the question Further information is requested label Apr 25, 2024
@mostafa mostafa closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants