-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from Dainii/authentication_and_saml
Add Rodauth authentication: local account + SAML
- Loading branch information
Showing
57 changed files
with
1,048 additions
and
115 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,10 +1,28 @@ | ||
# Database connection information | ||
DATABASE_USERNAME= | ||
DATABASE_PASSWORD= | ||
DATABASE_HOST=localhost | ||
DATABASE_PORT=5432 | ||
|
||
# Redis connection URL | ||
REDIS_URL= | ||
|
||
# Keys for data encryption | ||
# Can be generated with "bundle exec rails db:encryption:init" | ||
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY= | ||
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY= | ||
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT= | ||
|
||
# Enable authentication through external SAML IDP | ||
ENABLE_SAML_AUTH=false | ||
|
||
# Required | ||
SP_ENTITY_ID= | ||
ACS_URL= | ||
|
||
# Either provide a metadata endpoint | ||
METADATA_ENDPOINT= | ||
|
||
# Or a IDP service url and a certificate | ||
IDP_SERVICE_URL= | ||
IDP_CERTIFICATE= |
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,4 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationController < ActionController::Base | ||
private | ||
|
||
def current_account | ||
rodauth.rails_account | ||
end | ||
helper_method :current_account | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class AuthenticatedController < ApplicationController | ||
before_action :authenticate | ||
|
||
private | ||
|
||
def authenticate | ||
rodauth.require_account | ||
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 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,6 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
class HomeController < ApplicationController | ||
class HomeController < AuthenticatedController | ||
# GET / | ||
def index; 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 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
class RodauthController < ApplicationController | ||
# used by Rodauth for rendering views, CSRF protection, and running any | ||
# registered action callbacks and rescue_from handlers | ||
end |
Oops, something went wrong.