-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #413 from mbta/move_to_keycloak
Migrate to keycloak
- Loading branch information
Showing
26 changed files
with
372 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[ | ||
import_deps: [:phoenix], | ||
inputs: ["*.{ex,exs}", "{config,lib,test}/**/*.{ex,exs}"] | ||
plugins: [Phoenix.LiveView.HTMLFormatter], | ||
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
|
||
## Single Sign-on configuration. | ||
### Used for local dev, cloud environments make use of Terraform env vars | ||
# export KEYCLOAK_ISSUER= | ||
# export KEYCLOAK_CLIENT_ID= | ||
# export KEYCLOAK_CLIENT_SECRET= | ||
# export KEYCLOAK_IDP_HINT=oidc-mbta-entraid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
defmodule DocumentViewerWeb.AuthManager.ErrorHandler do | ||
@moduledoc """ | ||
Custom Guardian error handler. | ||
Custom Guardian error handler. If we ever get a token that does not seem valid this gets | ||
called. | ||
""" | ||
|
||
@behaviour Guardian.Plug.ErrorHandler | ||
|
||
alias DocumentViewerWeb.Router.Helpers | ||
use DocumentViewerWeb, :verified_routes | ||
|
||
@impl Guardian.Plug.ErrorHandler | ||
def auth_error(conn, {_type, _reason}, _opts) do | ||
Phoenix.Controller.redirect(conn, to: Helpers.auth_path(conn, :request, "cognito")) | ||
def auth_error(conn, {_type, reason}, _opts) | ||
when reason in [:unauthenticated, :token_expired] do | ||
Phoenix.Controller.redirect(conn, to: ~p"/auth/keycloak") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.