Skip to content

Misleading IsLoggedIn implementation in OpenIDConnectService #35

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

Open
AKissMail opened this issue May 8, 2025 · 0 comments
Open

Misleading IsLoggedIn implementation in OpenIDConnectService #35

AKissMail opened this issue May 8, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@AKissMail
Copy link

In the OpenIDConnectService class, the IsLoggedIn property is implemented as:

public bool IsLoggedIn { get => !string.IsNullOrEmpty(AccessToken); }

However, this implementation is misleading:

  1. The name and XML summary imply reliable login state detection, but the logic only checks whether the AccessToken is non-empty.
  2. There is no validation of the token's validity, expiry, or whether it has been revoked.
  3. This could lead to incorrect assumptions elsewhere in the application, where IsLoggedIn == true is interpreted as "user is currently authenticated".

Suggestion: Either rename the property to something more neutral (e.g. HasAccessToken) or implement a token validation there.

@AKissMail AKissMail added the bug Something isn't working label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant