Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcambass/ueberauth_todoist
Todoist OAuth2 strategy for Überauth
https://github.com/jcambass/ueberauth_todoist
Last synced: 18 days ago
JSON representation
Todoist OAuth2 strategy for Überauth
- Host: GitHub
- URL: https://github.com/jcambass/ueberauth_todoist
- Owner: Jcambass
- License: mit
- Created: 2020-03-01T14:16:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-15T02:28:01.000Z (4 months ago)
- Last Synced: 2024-10-16T09:36:02.901Z (about 1 month ago)
- Language: Elixir
- Homepage: https://hex.pm/packages/ueberauth_todoist
- Size: 41 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Überauth Todoist
> Todoist OAuth2 strategy for Überauth.
## Installation
1. Setup your application at [Todoist App Management](https://developer.todoist.com/appconsole.html).
1. Add `:ueberauth_todoist` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:ueberauth_todoist, "~> 1.0"}]
end
```1. Add Todoist to your Überauth configuration:
```elixir
config :ueberauth, Ueberauth,
providers: [
todoist: {Ueberauth.Strategy.Todoist, []}
]
```1. Update your provider configuration:
```elixir
config :ueberauth, Ueberauth.Strategy.Todoist.OAuth,
client_id: System.get_env("TODOIST_CLIENT_ID"),
client_secret: System.get_env("TODOIST_CLIENT_SECRET")
```Or, to read the client credentials at runtime:
```elixir
config :ueberauth, Ueberauth.Strategy.Todoist.OAuth,
client_id: {:system, "TODOIST_CLIENT_ID"},
client_secret: {:system, "TODOIST_CLIENT_SECRET"}
```1. Include the Überauth plug in your controller:
```elixir
defmodule MyApp.AuthController do
use MyApp.Web, :controllerpipeline :browser do
plug Ueberauth
...
end
end
```1. Create the request and callback routes if you haven't already:
```elixir
scope "/auth", MyApp do
pipe_through :browserget "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
end
```1. Your controller needs to implement callbacks to deal with `Ueberauth.Auth` and `Ueberauth.Failure` responses.
For an example implementation see the [Überauth Example](https://github.com/ueberauth/ueberauth_example) application.
## Calling
Depending on the configured url you can initiate the request through:
/auth/todoist
Or with options:
/auth/todoist?scope=data:read
Scope can be configured either explicitly as a `scope` query value on the request path or in your configuration:
```elixir
config :ueberauth, Ueberauth,
providers: [
github: {Ueberauth.Strategy.Todoist, [default_scope: "data:read"]}
]
```## License
Please see [LICENSE](https://github.com/jcambass/ueberauth_todoist/blob/master/LICENSE) for licensing details.