https://github.com/threez/oidc.cr
OIDC client for crystal
https://github.com/threez/oidc.cr
Last synced: over 1 year ago
JSON representation
OIDC client for crystal
- Host: GitHub
- URL: https://github.com/threez/oidc.cr
- Owner: threez
- License: mit
- Created: 2023-04-21T21:06:20.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-10T20:00:10.000Z (about 3 years ago)
- Last Synced: 2025-02-07T08:12:42.865Z (over 1 year ago)
- Language: Crystal
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# oidc [](https://github.com/threez/oidc.cr/actions/workflows/ci.yml) [](https://threez.github.io/oidc.cr/)
OIDC client for crystal extends the regular `OAuth2::Client`.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
oidc:
github: threez/oidc
```
2. Run `shards install`
## Usage
```crystal
require "oidc"
client = OIDC::Client.new("http://example.com/", "client-id", "ALSJDHJKASHGDJHGASKDJG")
# use the client to get authorize uri
state = UUID.random
client.get_authorize_uri("profile email roles openid", state.to_s)
# get access token for code
authorization_code = params["code"]
access_token = client.get_access_token_using_authorization_code(authorization_code)
```
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Vincent Landgraf](https://github.com/threez) - creator and maintainer