Class: SsoServer

Inherits:
Object
  • Object
show all
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

SsoOauthServer

Instance Method Summary collapse

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.

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_defaultsObject

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_instructionsObject

This method is abstract.

Return the welcome message

Returns String.

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_nameObject

This method is abstract.

Display name for this server, should be overridden by concrete implementations.

Returns String.

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.

Returns:

  • Hash

Raises:

  • NotImplementedError if the method is not implemented in the concrete class



49
50
51
# File 'lib/app/models/sso_server.rb', line 49

def (_code)
  raise NotImplementedError, 'Failed to retrieve user profile from provider'
end