photoprism / photoprism

AI-Powered Photos App for the Decentralized Web 🌈💎✨
https://www.photoprism.app
Other
34.21k stars 1.88k forks source link

Auth: Add `authorize` API endpoint to implement the authorization code flow #4368

Open lastzero opened 1 month ago

lastzero commented 1 month ago

The GET /api/v1/oauth/authorize API endpoint should gather consent and authorization from resource owners when using the Authorization Code Grant flow, optionally with PKCE:

Since we are using the (OpenID Foundation certified) github.com/zitadel/oidc library for the recently released OIDC client implementation, the authorize and userinfo API endpoints should also be based on it (as much as possible):

In addition, all pull requests should include unit tests - at least for the core functionality - to ensure that the changes work as expected: https://docs.photoprism.app/developer-guide/pull-requests/#acceptance-criteria


Documentation:

Protocol References:

Related Issues:

andiz2 commented 1 month ago

Hi friends! I can take care of this endpoint :). Would be so much fun.

lastzero commented 1 month ago

@andiz2 Excellent! Since we are using the (OpenID Foundation certified) github.com/zitadel/oidc library for the recently released OIDC client implementation, the authorize and userinfo API endpoints should also be based on it (as much as possible). I suggest starting with GET /api/v1/oauth/userinfo as this should be easier.

Do you already have experience developing in Go? I'll be happy to help and give feedback on possible solutions before you implement them :)

andiz2 commented 1 month ago

@lastzero Thanks for infos :). I've developed some projects in Go before so I can say I have some experience but I appreciate your kindness and will contact you for clarifications and feedback for sure.