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

Authentication for Mobile Apps #81

Open
gianlucafrei opened this issue May 6, 2021 · 3 comments
Open

Authentication for Mobile Apps #81

gianlucafrei opened this issue May 6, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@gianlucafrei
Copy link
Collaborator

gianlucafrei commented May 6, 2021

For mobile apps a cookie-based session mechanism is cumbersome to implement. Also, in contrast to a web-browser we can store a long term credential on a mobile device. Therefore we need a mechanism to support mobile apps or other client capable with persistent login. (e.g. mobile apps, native applications, external clients)

Proposal:
We add support for pass-trough authentication without any user session.

OIDC

  • In the login-provider configuration the JWK-Url must be defined of the pass-though tokens
  • If the request contains a valid Id-Token in a configured HTTP-Header, we create the user model from the id token
  • Downstream authentication is not changed. That means the id token will be replaced with the OAG generated JWT unless otherwise specified in the configuration.
  • No state is stored on OAG

GitHub (OAuth2 but not OIDC)

  • Because GitHub does not have any kind of id-token and the access-token is opaque, the only option is that the client send the access-token with the request, and OAG uses the GitHub API to get the user information.
  • We would need to cache the user information on OAG to avoid a GitHub Api lookup with every request

Implementation
The login driver interface gets an additional method checkPassthroughAuthentication(HTTPRequest)->UserModel that is called if no session cookie is found. If the method returns a UserModel, this is used. If the method returns null, the request is anonymous. If a InvalidAuthenticationException is thrown, the request is blocked.

@gianlucafrei gianlucafrei added the enhancement New feature or request label May 6, 2021
@gianlucafrei gianlucafrei self-assigned this May 6, 2021
@gianlucafrei
Copy link
Collaborator Author

@Padi-owasp Does this make sense for you? Any improvement ideas?

@Padi-owasp
Copy link
Member

See Mail comments ;-)

@Padi-owasp
Copy link
Member

Padi-owasp commented May 7, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants