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

When using SSO (okta) logs only show when a user logs out but not in #2146

Closed
gneville-ot opened this issue Aug 5, 2022 · 1 comment · Fixed by #2679
Closed

When using SSO (okta) logs only show when a user logs out but not in #2146

gneville-ot opened this issue Aug 5, 2022 · 1 comment · Fixed by #2679
Assignees
Labels
type: bug Something isn't working as expected

Comments

@gneville-ot
Copy link

Environment

  • Python version: 3.10
  • Nautobot version: 1.3.8

Steps to Reproduce

  1. Setup nautobot with SSO against OKTA
  2. Attempt to login using SSO with a valid user
  3. Attempt to logout

Expected Behavior

You will see both a login and logout message printed to stdout for the user

Observed Behavior

You only see a logout message printed to stdout for the user

Extra Info

As a temporary solution I changed the code in https://github.com/nautobot/nautobot/blob/develop/examples/okta/group_sync.py and added the following so I can get a log for when a user using OKTA logs in:

<--snip-->
loggerauth = logging.getLogger("nautobot.auth.login")
<--snip-->

def group_sync(uid, user=None, response=None, *args, **kwargs):
<--snip-->
    loggerauth.info(f"User {uid} successfully authenticated")
<--snip-->
@bryanculver bryanculver added the type: bug Something isn't working as expected label Aug 9, 2022
@lampwins
Copy link
Member

Django should have a signal that it uses to update the last_login timestamp for user. Hooking into that signal is likely the best way to solve this.

@gsnider2195 gsnider2195 self-assigned this Oct 24, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants