Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
feat: add deprecation notice and publish last version
Browse files Browse the repository at this point in the history
  • Loading branch information
Creaous committed Apr 9, 2024
1 parent 3b73ef4 commit f21c89f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 14 deletions.
52 changes: 40 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,62 @@
![NPM Downloads](https://img.shields.io/npm/dt/%40nexirift%2Fplugin-keycloak)

# plugin-keycloak
A basic [GraphQL Yoga](https://github.com/dotansimha/graphql-yoga) plugin that adds functionality to authenticate users using the [Keycloak](https://www.keycloak.org/) service.

A basic [GraphQL Yoga](https://github.com/dotansimha/graphql-yoga) plugin that
adds functionality to authenticate users using the
[Keycloak](https://www.keycloak.org/) service.

## Deprecation Notice

As of the 9th of April 2024,
[plugin-keycloak](https://github.com/Nexirift/plugin-keycloak) has been
deprecated, effective immediately. If you wish to use this package, please
switch to [plugin-oidc](https://github.com/Nexirift/plugin-oidc) as that will be
our new maintained version. The new plugin will have support for OpenID Connect
compatible clients meaning that you can use other services like
[Authentik](https://goauthentik.io).

## How does it work?

This plugin checks an access token which is a `Bearer` token on the `Authentication` header with the Keycloak server to verify if it's valid. Additionally, it passes back the response info, which includes information like the `preferred_username`, this can then be used in the GraphQL Yoga server to identify users.
This plugin checks an access token which is a `Bearer` token on the
`Authentication` header with the Keycloak server to verify if it's valid.
Additionally, it passes back the response info, which includes information like
the `preferred_username`, this can then be used in the GraphQL Yoga server to
identify users.

## BREAKING CHANGES

Starting from [v1.1.5](https://github.com/Nexirift/plugin-keycloak/releases/tag/1.1.5), we have removed the dependency of `keycloak-backend`. In addition, we have changed `ITokenContent` to `KeycloakToken`, please update these in your code. You can also see this [commit](https://github.com/Nexirift/plugin-keycloak-example/commit/6dcf3c9dc93351006b63005f7e398cc72fa84522) for changes.
Starting from
[v1.1.5](https://github.com/Nexirift/plugin-keycloak/releases/tag/1.1.5), we
have removed the dependency of `keycloak-backend`. In addition, we have changed
`ITokenContent` to `KeycloakToken`, please update these in your code. You can
also see this
[commit](https://github.com/Nexirift/plugin-keycloak-example/commit/6dcf3c9dc93351006b63005f7e398cc72fa84522)
for changes.

## Example

Please see [here](https://github.com/Nexirift/plugin-keycloak-example) for an example of how to use the project.
Please see [here](https://github.com/Nexirift/plugin-keycloak-example) for an
example of how to use the project.

## Disclaimer

We are working on trying to stop depending on so many dependencies. As part of this, we have copied some code from the keycloak-backend library. This project, at the time of writing, is using the MIT license. The files that were took were:
We are working on trying to stop depending on so many dependencies. As part of
this, we have copied some code from the keycloak-backend library. This project,
at the time of writing, is using the MIT license. The files that were took were:

- `Token.ts` -> `token.ts`
- `Keycloak.ts` -> `keycloak.ts`
- `Jwt.ts` -> `jwt.ts`
- `Token.ts` -> `token.ts`
- `Keycloak.ts` -> `keycloak.ts`
- `Jwt.ts` -> `jwt.ts`

We plan to adapt these files more as we change around our codebase. For example, the new scopes feature that was mentioned in issue [#2](https://github.com/Nexirift/plugin-keycloak/issues/2).
We plan to adapt these files more as we change around our codebase. For example,
the new scopes feature that was mentioned in issue
[#2](https://github.com/Nexirift/plugin-keycloak/issues/2).

## Credits

Disclaimer: This plugin was based off of the plugin-jwt source code.

- [GraphQL Yoga](https://github.com/dotansimha/graphql-yoga)
- [Keycloak](https://www.keycloak.org/)
- [plugin-jwt](https://github.com/dotansimha/graphql-yoga/tree/main/packages/plugins/jwt)
- [GraphQL Yoga](https://github.com/dotansimha/graphql-yoga)
- [Keycloak](https://www.keycloak.org/)
- [plugin-jwt](https://github.com/dotansimha/graphql-yoga/tree/main/packages/plugins/jwt)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nexirift/plugin-keycloak",
"version": "1.1.5",
"version": "1.1.6",
"type": "commonjs",
"description": "Plugin for GraphQL Yoga that adds Keycloak authentication and authorization.",
"author": "Nexirift",
Expand Down Expand Up @@ -30,4 +30,4 @@
"access": "public"
},
"main": "dist/index.js"
}
}

0 comments on commit f21c89f

Please sign in to comment.