open-index/open-npm huggingface dataset:
npm package: @jeff-tian/gitbook-plugin-github
Description: Integrate your website with your GitHub repository.
Latest version: 3.0.23

## plugin-github

Display a link to your GitHub repo in your gitbook.

### Usage

Put this in your book.json:

```js
{
    "plugins": [ "github" ],
    "pluginsConfig": {
        "github": {
            "url": "https://github.com/your/repo"
        }
    }
}
```

And you're done!

### Credits

Original work by [@mjackson](https://github.com/mjackson).
npm package: @jeff-tian/keycloak-koa-connect
Description: Keycloak Connect Middleware base on koa
Author: Red Hat, Inc.
Latest version: 3.5.2

# Keycloak Koa Adapter

> The official version is Express， so this is Koa version. See [here](https://github.com/keycloak/keycloak-nodejs-connect) for more information

[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/jeff-tian/keycloak-koa-connect)
[![Build Status](https://travis-ci.com/Jeff-Tian/keycloak-koa-connect.svg?branch=master)](https://travis-ci.com/Jeff-Tian/keycloak-koa-connect)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Install

```bash
npm i @jeff-tian/keycloak-koa-connect --save
```

## Example

Please see [/example](https://github.com/anthinkingcoder/keycloak-koa-connect/tree/master/example)

## License

- [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
npm package: @jeff-tian/keycloak-passport
Description: Flexible Keycloak Passport strategy (with multi-realm support) by EXL Inc.
Author: Jeff Tian
Latest version: 1.0.0

# Keycloak Passport Strategy - oAuth2/OIDC

> Production-ready multi-realm implementation of a Keycloak Passport Strategy 

[![Build Status](https://travis-ci.com/Jeff-Tian/keycloak-passport.svg?branch=master)](https://travis-ci.com/Jeff-Tian/keycloak-passport)

This library offers a production-ready and maintained Keycloak Passport connector that offers the following key features:

- Use multiple realms in the same application (multi-tenancy)

- Use with oAuth2/Open ID Connect 'clients' in keycloak

- Fetch users' data from keycloak automatically via the JSON API

## Listed Keycloak Extension

Check it out on [keycloak.org](https://www.keycloak.org/extensions.html)

## Why? Hasn't this already been done?

To a certain extent, yes. There are about 3 to 4 repos that brand themselves as 'Keycloak Passport', yet not a single one of them is actively maintained and most of them are either completely empty, don't allow using multiple realms, only implement part of the protocol, and/or don't fetch the user's data from Keycloak. There also exists a dedicated NodeJS connector by the Keycloak project itself, however, it is unusable if you are seeking to have Keycloak as 'yet another' passport strategy in your app. This project fills that gap.

## Usage

## Install

```bash
npm install @jeff-tian/keycloak-passport
```

### Import

```javascript
import KeycloakStrategy from "@jeff-tian/keycloak-passport";
```

### Initialize

```javascript
// Register the strategy with passport
passport.use(
  "keycloak",
  new KeycloakStrategy(
    {
      host: process.env.KEYCLOAK_HOST,
      realm: process.env.KEYCLOAK_REALM,
      clientID: process.env.KEYCLOAK_CLIENT_ID,
      clientSecret: process.env.KEYCLOAK_CLIENT_SECRET,
      callbackURL: `/api${AUTH_KEYCLOAK_CALLBACK}`
    },
    (accessToken, refreshToken, profile, done) => {
      // This is called after a successful authentication has been completed
      // Here's a sample of what you can then do, i.e., write the user to your DB
      User.findOrCreate({ email: profile.email }, (err, user) => {
        assert.ifError(err);
        user.keycloakId = profile.keycloakId;
        user.imageUrl = profile.avatar;
        user.name = profile.name;
        user.save((err, savedUser) => done(err, savedUser));
      });
    }
  )
);
```

### Routes

```javascript
router.get(
  routes.AUTH_KEYCLOAK,
  passport.authenticate("keycloak", DEFAULT_PASSPORT_OPTIONS)
);
router.get(
  routes.AUTH_KEYCLOAK_CALLBACK,
  passport.authenticate("keycloak", DEFAULT_PASSPORT_OPTIONS),
  AuthController.keyCloakSuccess
);
```

## Compatability with next-auth

There are some known issues with using this passportjs strategy with the latest versions of next-auth. Follow the discussion [here](https://github.com/jeff-tian/keycloak-passport/issues/1).

## Contributing/feedback

All forms of contribution are welcome via Issues and Pull-requests to this repo