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

feat: Implement auth-keycloak plugin #188

Conversation

fumblehool
Copy link

@fumblehool fumblehool commented Oct 9, 2023

PR for Keycloak-Auth-Plugin - amplication/amplication#7044

@fumblehool fumblehool marked this pull request as ready for review October 14, 2023 19:18
@levivannoort levivannoort linked an issue Oct 16, 2023 that may be closed by this pull request
@abrl91
Copy link

abrl91 commented Oct 18, 2023

@fumblehool Thank you. We'll review your PR soon

@fumblehool
Copy link
Author

hi, @abrl91 please review the PR 😄

@overbit overbit added the enhancement New feature or request label Oct 30, 2023
@overbit overbit requested a review from Shurtu-gal November 7, 2023 12:04

## Prerequisites

- Running [Keycloak](https://www.keycloak.org/) instance. You can use the `docker-compose.dev.yaml`` file dor dev container.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Running [Keycloak](https://www.keycloak.org/) instance. You can use the `docker-compose.dev.yaml`` file dor dev container.
- Running [Keycloak](https://www.keycloak.org/) instance. You can use the `docker-compose.dev.yml`` file or dev container.

Also the docker-compose.dev.yml is created after the plugin is run. Due to this settings regarding keycloak cannot be provided before that leading to circular dependency.

Comment on lines +15 to +21
- `KEYCLOAK_REALM`: Name of the realm to be used for authentication (or the one you just created)
- `KEYCLOAK_CLIENT_ID`: Client ID of the client to be used for authentication (or the client we just created)
- `KEYCLOAK_CLIENT_SECRET`: Client Secret of the client to be used for authentication.
Copy link
Collaborator

Choose a reason for hiding this comment

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

These can only be provided after the keycloak is setup right?

Copy link
Author

Choose a reason for hiding this comment

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

Right. These are manually created by Admin.
Keycloak allows admin to create multiple realms and in order to connect, these are required.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But this is needed in plugin, so I suggest to let the users start up keycloak themselves by using a docker-compose file provided by you. Maybe can include the steps in README. Then they can provide these values to plugin.

Copy link
Collaborator

@Shurtu-gal Shurtu-gal left a comment

Choose a reason for hiding this comment

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

The seed file in scripts is having password service import which is not available also.

@@ -0,0 +1,33 @@
import { ConfigService } from "@nestjs/config";
import { PassportStrategy } from "@nestjs/passport";
import { KeycloakStrategy } from "@exlinc/keycloak-passport";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not added in created package.json.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, this is creating multiple problems as it doesn't have types and needs a declaration file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

image
Some fields like authorizationURL, tokenURL are missing. Could you look into this?

@mulygottlieb
Copy link
Contributor

@fumblehool are you working on the comments from @Shurtu-gal?
Please indicate if you plan to complete this, thanks!

@fumblehool
Copy link
Author

Hi @mulygottlieb,
Yes, I'm working on this.
I'll try to update the PR soon.

@fumblehool fumblehool force-pushed the fumblehool/feat/plugin-keycloak-auth branch from 01dc257 to 2c3edb4 Compare November 21, 2023 15:00
@fumblehool fumblehool force-pushed the fumblehool/feat/plugin-keycloak-auth branch from 2c3edb4 to 0810f2a Compare November 21, 2023 15:02
@overbit
Copy link
Contributor

overbit commented Nov 24, 2023

@fumblehool as we added some automation to this repo, it would be a great idea to merge the latest master changes to your branch

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @fumblehool , how are you ? thank you for the plugin. I started my review and I noticed that your plugin demands changes on auth-jwt plugin. as a rule of thumb, we would like to keep the plugins decoupled one from another. the reason is that each plugin should function on a specific level of logic without the knowledge of the rest of the changes. so, in order to continue with this plugin, we need to remove the changes on auth-jwt and specify them on auth-keycloak plugin. we design the process that it enable you the access to all files, so you can take the related file and change it so it will fits your needs.

@overbit
Copy link
Contributor

overbit commented Dec 15, 2023

@fumblehool any update?

@Shurtu-gal Shurtu-gal closed this Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

⭐️ Plugin: Keycloak
6 participants