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

No username or email provided #201

Closed
Okman321456 opened this issue Sep 5, 2023 · 0 comments
Closed

No username or email provided #201

Okman321456 opened this issue Sep 5, 2023 · 0 comments

Comments

@Okman321456
Copy link

Hi, I have used your package to login sso with Okta IdP.
When call login from browser, it will direct to login page of Okta. After login, it will call to acs/ path. And raise an error [django_saml2_auth.utils.handle_exception] No username or email provided.
I have no idea for this problem. Please help me with that. Thank you so much!
This is my setting:
SAML2_AUTH = {
'DEFAULT_NEXT_URL': '/admin/', # after login, it will redirect to this URL.
'ENTITY_ID': "https://090e-14-176-231-159.ngrok-free.app/sso/acs/",
'NAME_ID_FORMAT': 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
'USE_JWT': False, # use JWT for info storage, can be True or False
'KEY_FILE': './private_key.pem',
'CERT_FILE': './public_certificate.pem',
'ENCODING': 'UTF-8',
'LOGIN_URL': [http:url/to/okta/login/],
'METADATA_AUTO_CONF_URL': [http:url/to/okta/metadata],
'ASSERTION_URL': 'https://090e-14-176-231-159.ngrok-free.app',
'ATTRIBUTES_MAP': {
# Change Email/UserName/FirstName/LastName to corresponding SAML2 userprofile attributes.
'email': 'user.email',
'username': 'user.username',
'first_name': 'user.first_name',
'last_name': 'user.last_name',
},
'CREATE_USER': True, # Create a new Django user when a new user logs in. Defaults to True.
'NEW_USER_PROFILE': {
'USER_GROUPS': [], # The default group name when a new user logs in
'ACTIVE_STATUS': True, # The default active status for new users
'STAFF_STATUS': False, # The staff status for new users
'SUPERUSER_STATUS': False, # The superuser status for new users
},
'LOGIN_CASE_SENSITIVE': True, # whether of not to get the user in case_sentive mode
'AUTHN_REQUESTS_SIGNED': True, # Require each authentication request to be signed
'WANT_ASSERTIONS_SIGNED': True, # Require each assertion to be signed
'WANT_RESPONSE_SIGNED': True, # Require response to be signed
'LOGGING': {
'version': 1,
'formatters': {
'simple': {
'format': '[%(asctime)s] [%(levelname)s] [%(name)s.%(funcName)s] %(message)s',
},
},
'handlers': {
'stdout': {
'class': 'logging.StreamHandler',
'stream': 'ext://sys.stdout',
'level': 'DEBUG',
'formatter': 'simple',
},
},
'loggers': {
'saml2': {
'level': 'DEBUG'
},
},
'root': {
'level': 'DEBUG',
'handlers': [
'stdout',
],
},
},
}

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

1 participant