-
Notifications
You must be signed in to change notification settings - Fork 123
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 pluggable authentication in the grid #3058
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the level of abstraction makes sense. Probably worth us using this to connect to auth0 or another easy to set up provider to shake out any issues though.
common-lib/src/main/scala/com/gu/mediaservice/lib/auth/provider/Authentication.scala
Outdated
Show resolved
Hide resolved
common-lib/src/main/scala/com/gu/mediaservice/lib/auth/provider/AuthenticationProvider.scala
Outdated
Show resolved
Hide resolved
64703d5
to
8c01360
Compare
8c01360
to
5b9d728
Compare
Seen on auth, usage, collections, image-loader, image-loader-projection, metadata-editor (merged by @sihil 9 minutes and 49 seconds ago) Please check your changes! |
What does this change?
The grid is currently hardwired into the Guardian's https://github.com/guardian/pan-domain-authentication library. This is specific to the guardian and it makes sense that other adopters would want to blaze their own trail.
This PR:
Consumers need to implement a
UserAuthenticationProvider
trait. They can also implement aMachineAuthenticationProvider
trait to override the way machine to machine calls can be done. These are defined as shown below.Much like the pluggable image processor pipeline, these authentication providers are loaded dynamically at runtime. The loader supports companion objects and also classes with constructors that can optionally have arguments (a
play.api.Configuration
instance and/or aAuthenticationProviderResources
instance - shown below).TODO
Authentication
class into the application (and remove the existing version)AuthenticationProviderResources
that can be passed into a providerPandaUser
more generic (possibly including aTypedMap
for extensions?)PandaAuthenticationProvider(fairly hard to do and only used by the Guardian)Follow on PRs
How can success be measured?
Other organisations are able to implement their own idea of authentication without having to fight with the Guardian's pan domain authentication library.
Who should look at this?
It would be great to have @mbarton and @akash1810 review this PR.
Tested?