Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rubenmoya/adonis-ally-gitlab
A Gitlab driver of AdonisJS Ally
https://github.com/rubenmoya/adonis-ally-gitlab
adonis-ally adonis-ally-gitlab adonis-framework adonisjs
Last synced: 22 days ago
JSON representation
A Gitlab driver of AdonisJS Ally
- Host: GitHub
- URL: https://github.com/rubenmoya/adonis-ally-gitlab
- Owner: rubenmoya
- License: mit
- Created: 2021-09-24T07:13:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-23T22:27:27.000Z (9 months ago)
- Last Synced: 2024-03-24T02:43:52.783Z (8 months ago)
- Topics: adonis-ally, adonis-ally-gitlab, adonis-framework, adonisjs
- Language: TypeScript
- Homepage:
- Size: 36.1 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-adonisjs - AdonisJS Ally Gitlab - A Gitlab driver for AdonisJS Ally (Packages)
README
# Adonis Ally Gitlab Driver
[![NPM version](https://img.shields.io/npm/v/adonis-ally-gitlab.svg)](https://www.npmjs.com/package/adonis-ally-gitlab)
A [Gitlab](https://gitlab.com/) driver for [AdonisJS Ally](https://docs.adonisjs.com/guides/auth/social).
You can authenticate with your self hosted gitlab or with https://gitlab.com/## Getting started
### 1. Install the package
Install the package from your command line.
```bash
npm install --save adonis-ally-gitlab
```or
```bash
yarn add adonis-ally-gitlab
```### 2. Configure the package
```bash
node ace configure adonis-ally-gitlab
```### 3. Validate environment variables
```ts
GITLAB_URL: Env.schema.string(),
GITLAB_CLIENT_ID: Env.schema.string(),
GITLAB_CLIENT_SECRET: Env.schema.string(),
```### 4. Add variables to your ally configuration
```ts
const allyConfig: AllyConfig = {
// ... other drivers
gitlab: {
driver: 'gitlab',
gitlabUrl: 'https://gitlab.example.com/'
clientId: Env.get('GITLAB_CLIENT_ID'),
clientSecret: Env.get('GITLAB_CLIENT_SECRET'),
callbackUrl: 'http://localhost:3333/gitlab/callback',
},
}
```If you don't supply gitlabUrl, https://www.gitlab.com/ will be used.
When using self hosted gitlab,
get the clientId and clientSecret from /admin/applications/ on your gitlab instance.## Scopes
You can pass an array of scopes in your configuration, for example `['read_user', 'profile', 'api']`. You have a full list of scopes in the [Gitlab Oauth documentation](https://docs.gitlab.com/ee/integration/oauth_provider.html#authorized-applications)
## How it works
You can learn more about [AdonisJS Ally](https://docs.adonisjs.com/guides/auth/social) in the documentation. And learn about the implementation in the [ally-driver-boilerplate](https://github.com/adonisjs-community/ally-driver-boilerplate) repository.
## Contributing
1. Fork the repo
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'feat: Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D## License
[MIT](LICENSE)