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

Added Keycloak OAuth2 Provider #4660

Closed
wants to merge 4 commits into from

Conversation

Mabenan
Copy link

@Mabenan Mabenan commented Nov 10, 2022

What does this PR do?

Adds Keycloak OAuth2

Test Plan

Created Small Flutter Web Application with the following call
Account(client).createOAuth2Session(provider: "keycloak", success: baseUri.resolve("success.html").toString(), failure: baseUri.resolve("failure.html").toString());

Related PRs and Issues

#4653

Have you added your change to the Changelog?

Yes

Have you read the Contributing Guidelines on issues?

Yes

@Mabenan Mabenan marked this pull request as ready for review November 10, 2022 09:00
@stnguyen90
Copy link
Contributor

@Mabenan thanks for this! Considering you know Keycloak and you've gone through the process of creating an OAuth provider, do you think it's possible to implement an OIDC Provider? How difficult would it be?

Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

@Mabenan Great PR! 🤯 I still need to test this, but I've left my initial comments.

composer.lock Outdated Show resolved Hide resolved
package-lock.json Outdated Show resolved Hide resolved
src/Appwrite/Auth/OAuth2/Keycloak.php Outdated Show resolved Hide resolved
@Mabenan
Copy link
Author

Mabenan commented Nov 10, 2022

@Mabenan thanks for this! Considering you know Keycloak and you've gone through the process of creating an OAuth provider, do you think it's possible to implement an OIDC Provider? How difficult would it be?

The big difference between an generic oidc and the normal OAuths would be that we need to make a request to the .well-known endpoint of the service to get the correct endpoints. Because the endpoints for auth, token and userinfo are the only things that are different between the oauth servises.

The Customizing would be
Client
Client Secret
Scheme Endpoint

@Mabenan
Copy link
Author

Mabenan commented Nov 10, 2022

@Mabenan thanks for this! Considering you know Keycloak and you've gone through the process of creating an OAuth provider, do you think it's possible to implement an OIDC Provider? How difficult would it be?

The big difference between an generic oidc and the normal OAuths would be that we need to make a request to the .well-known endpoint of the service to get the correct endpoints. Because the endpoints for auth, token and userinfo are the only things that are different between the oauth servises.

The Customizing would be
Client
Client Secret
Scheme Endpoint

Also we need to think about how we make it possible to have multiple generic oidc

@stnguyen90
Copy link
Contributor

need to make a request to the .well-known endpoint

Right. It's a few extra API calls, but I don't think it should be too big of a deal.

how we make it possible to have multiple generic oidc

Oh that's a great point...

@stnguyen90 stnguyen90 self-requested a review November 15, 2022 16:35
@stnguyen90 stnguyen90 linked an issue Nov 23, 2022 that may be closed by this pull request
2 tasks
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

@Mabenan
Copy link
Author

Mabenan commented Nov 24, 2022

Frontend Changes removed

@Mabenan
Copy link
Author

Mabenan commented Jan 12, 2023

Any news on this, is something missing?

@binaryfire
Copy link

binaryfire commented Jan 15, 2023

Hi all. Any updates on this? Keycloak integration is essential for our clients.

@valentinschabschneider
Copy link

Any news? we need this

@Mabenan Mabenan requested a review from stnguyen90 April 18, 2023 07:33
{
if (empty($this->tokens)) {
$headers = ['Content-Type: application/x-www-form-urlencoded'];
$this->tokens = \json_decode($this->request(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm trying to test this, but I'm just getting false back for the response from Keycloak. Any ideas what I configured incorrectly?

Copy link
Author

Choose a reason for hiding this comment

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

I would withdraw this because of the new generell oicd provoder

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

Successfully merging this pull request may close these issues.

🚀 Feature: Keycloak OAuth Provider
5 participants