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

Add support for an openid provider #243

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

indykoning
Copy link
Contributor

This paves the way for SSO without proxy authentication by using socialite with a custom class for basic openid support.

Currently we're only using and registering our own openid class.
However it has been built that other providers can be easily added in the future as it uses socialite as it's base.
Which comes with quite a few drivers built in, and more community made ones are available https://socialiteproviders.com/

@@ -68,12 +68,18 @@ const router = new Router({
],
});

const urlParams = new URLSearchParams(window.location.search);

if (urlParams.has('authenticated')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply to tell the system we should be authenticated and it'll check.
If this is used illegitimately it will have no impact and you will be sent to the login page.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI
I removed this before the merge because the vue3 front-end no longer uses Vue.$storage.set('authenticated', true) to track authentication. I'm going to replace it with something similar that matches the new version of the front-end.

@Bubka
Copy link
Owner

Bubka commented Nov 21, 2023

Thanks for your contribution Indy 👍🏻

It will take me some time to review/merge it as I've never used Socialite (I will have to delve into its doc) and I'm currently working on migrating to Vue v3 with significant changes to the front-end architecture.

Do you plan to add some tests? (If relevant)

@indykoning
Copy link
Contributor Author

That is no problem whatsoever, take your time!

In this case tests will be difficult to make as it would need a functioning OpenID Provider and correct tokens to get data from these OpenID providers. The return token is invalidated after use thus a new token would have to be obtained from the Provider every test.

In a nutshell Socialite wraps many external Login providers to work in the redirect -> callback flow and format the user information in a uniform way so we can use https://github.com/Bubka/2FAuth/pull/243/files#diff-b92ae0dfa3532466a67de136444c1c07ef4fd207e222ea28f6680b367242f747R27

No matter what provider is used, be it Steam, Google, Facebook, Authentik (My usecase)

@Bubka Bubka added this to the v5.0 milestone Dec 6, 2023
@Bubka Bubka changed the base branch from master to dev December 6, 2023 08:00
@Bubka Bubka merged commit a407f47 into Bubka:dev Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

2 participants