Überauth IBMId
IBMId OAuth2 strategy for Überauth.
This package is still in testing
Installation
Setup your application OpenID Connect.
Add
:ueberauth_ibmidto your list of dependencies inmix.exs:def deps do[...{:ueberauth_ibmid, "~> 0.1.0"}...]endAdd IBMId to your Überauth configuration:
config :ueberauth, Ueberauth,providers: [ibmid: {Ueberauth.Strategy.IBMId, []}]Update your provider configuration:
config :ueberauth, Ueberauth.Strategy.IBMId.OAuth,client_id: System.get_env("IBMID_OIDC_CLIENT_ID"),client_secret: System.get_env("IBMID_OIDC_CLIENT_SECRET")Or, to read the client credentials at runtime
config :ueberauth, Ueberauth.Strategy.IBMId.OAuth,client_id: {:system, "IBMID_OIDC_CLIENT_ID"},client_secret: {:system, "IBMID_OIDC_CLIENT_SECRET"}Include the Überauth plug in your controller:
defmodule MyApp.Router douse MyApp.Web, :routerpipeline :browser doplug Ueberauth...endendCreate the request and callback routes if you haven't already:
scope "/auth", MyApp dopipe_through :browserget "/:provider", AuthController, :requestget "/:provider/callback", AuthController, :callbackendAnd make sure to set the correct redirect URI(s) in your AppID application to wire up the callback.
Your controller needs to implement callbacks to deal with
Ueberauth.AuthandUeberauth.Failureresponses.
For an example implementation see the Überauth Example application.
Calling
Depending on the configured url you can initialize the request through:
/auth/ibmid
config :ueberauth, Ueberauth,
providers: [
ibmid: {Ueberauth.Strategy.IBMId, [default_scope: "openid"]}
]
License
Please see LICENSE for licensing details.