greatbit / quack

Web Based Test Management System
Apache License 2.0
124 stars 36 forks source link

Document "pluggable authentication" #231

Open mpelley opened 1 year ago

mpelley commented 1 year ago

I can't find where it describes how to create an authentication plugin. We would like to use Google's authentication. How do we do that?

azee commented 1 year ago

To implement a custom auth provider you have to implement AuthProvider interface

https://github.com/greatbit/whoru/blob/900b9fdf360e18898dd7c78936189f2e40b10d13/auth/src/main/java/ru/greatbit/whoru/auth/AuthProvider.java#L9

Or extend from BaseAuthProvider, like it is done in Cognito Auth Provider https://github.com/greatbit/whoru/blob/master/cognito-auth-provider/src/main/java/ru/greatbit/whoru/auth/providers/CognitoAuthProvider.java

Alternatively you can just use cognito auth provider and set up Cognito to use google as an IDP https://aws.amazon.com/premiumsupport/knowledge-center/cognito-google-social-identity-provider/

azee commented 1 year ago

In fact, I just enabled google auth using Cognito Auth Provider in cloud.testquack.com

Please just use Cognito Auth Provider and then follow https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html