https://github.com/jenkinsdev/ueberauth_notion
An Ueberauth strategy for using Notion to authenticate your users.
https://github.com/jenkinsdev/ueberauth_notion
Last synced: 2 months ago
JSON representation
An Ueberauth strategy for using Notion to authenticate your users.
- Host: GitHub
- URL: https://github.com/jenkinsdev/ueberauth_notion
- Owner: JenkinsDev
- License: mit
- Created: 2023-03-23T15:15:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-10T13:27:32.000Z (about 3 years ago)
- Last Synced: 2025-08-16T04:15:28.467Z (10 months ago)
- Language: Elixir
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Überauth Notion
[](https://hex.pm/packages/ueberauth_notion)
[](https://hexdocs.pm/ueberauth_notion/)
> Notion OAuth2 strategy for Überauth.
## Installation
1. Setup your application by following the [following guide](https://developers.notion.com/docs/create-a-notion-integration).
2. Add `:ueberauth_notion` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:ueberauth_notion, "~> 0.1.1"}
]
end
```
3. Add Notion to your Überauth configuration:
```elixir
config :ueberauth, Ueberauth,
providers: [
notion: {Ueberauth.Strategy.Notion, []}
]
```
4. Update your provider configuration:
```elixir
config :ueberauth, Ueberauth.Strategy.Notion.OAuth,
client_id: System.get_env("NOTION_CLIENT_ID"),
client_secret: System.get_env("NOTION_CLIENT_SECRET"),
redirect_uri: System.get_env("NOTION_REDIRECT_URI")
```
Or, to read the client credentials at runtime:
```elixir
config :ueberauth, Ueberauth.Strategy.Github.OAuth,
client_id: {:system, "NOTION_CLIENT_ID"},
client_secret: {:system, "NOTION_CLIENT_SECRET"},
redirect_uri: {:system, "NOTION_REDIRECT_URI"}
```
5. Include the Überauth plug in your router:
```elixir
defmodule MyApp.Router do
use MyApp.Web, :router
pipeline :browser do
plug Ueberauth
...
end
end
```
6. Create the request and callback routes if you haven't already:
```elixir
scope "/auth", MyApp do
pipe_through :browser
get "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
end
```
7. 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/notion