Class: SsoServer
- Inherits:
-
Object
- Object
- SsoServer
- Includes:
- SearchAble, StandardModel
- Defined in:
- lib/app/models/sso_server.rb
Overview
Base server container for an account which can have 0..N sso servers configured.
Direct Known Subclasses
Instance Method Summary collapse
-
#auth_code_url(request, _parameters = {}) ⇒ Object
abstract
URL.
- #customize_defaults ⇒ Object abstract
-
#display_instructions ⇒ Object
abstract
String.
-
#display_name ⇒ Object
abstract
String.
-
#user_profile(_code) ⇒ Object
abstract
user profile address, this should be implemented by the child class.
Instance Method Details
#auth_code_url(request, _parameters = {}) ⇒ Object
This method is abstract.
Get the authentication URL for the SSO Server, must be implemented by the concrete class
Returns URL.
55 56 57 58 59 60 |
# File 'lib/app/models/sso_server.rb', line 55 def auth_code_url(request, _parameters = {}) return if request.is_a?(SsoUserLoginRequest) request = request.becomes(SsoUserLoginRequest) request.update! sso_server: self end |
#customize_defaults ⇒ Object
This method is abstract.
Default is to do nothing, but subclasses may override this
31 |
# File 'lib/app/models/sso_server.rb', line 31 def customize_defaults; end |
#display_instructions ⇒ Object
This method is abstract.
Return the welcome message
Returns String.
41 42 43 |
# File 'lib/app/models/sso_server.rb', line 41 def display_instructions "Click to get started with #{display_name}" end |
#display_name ⇒ Object
This method is abstract.
Display name for this server, should be overridden by concrete implementations.
Returns String.
35 36 37 |
# File 'lib/app/models/sso_server.rb', line 35 def display_name 'SSO Server' end |
#user_profile(_code) ⇒ Object
This method is abstract.
Using the appropriate SSO server configuration obtain the
user profile address, this should be implemented by the child class.
49 50 51 |
# File 'lib/app/models/sso_server.rb', line 49 def user_profile(_code) raise NotImplementedError, 'Failed to retrieve user profile from provider' end |