Class: OmniAuth::Strategies::Crowd::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/strategies/crowd/configuration.rb

Constant Summary collapse

DEFAULT_SESSION_URL =
"%s/rest/usermanagement/latest/session"
DEFAULT_AUTHENTICATION_URL =
"%s/rest/usermanagement/latest/authentication"
DEFAULT_USER_GROUP_URL =
"%s/rest/usermanagement/latest/user/group/direct"
DEFAULT_CONTENT_TYPE =
'application/xml'
'crowd.token_key'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Configuration

Returns a new instance of Configuration.

Parameters:

  • params (Hash)

    configuration options

Options Hash (params):

  • :crowd_server_url (String, nil)

    the Crowd server root URL; probably something like ‘crowd.mycompany.com` or `crowd.mycompany.com/crowd`; optional.

  • :crowd_authentication_url (String, nil) — default: :crowd_server_url + '/rest/usermanagement/latest/authentication'

    the URL to which to use for authenication; optional if ‘:crowd_server_url` is specified, required otherwise.

  • :application_name (String, nil)

    the application name specified in Crowd for this application, required.

  • :application_password (String, nil)

    the application password specified in Crowd for this application, required.

  • :disable_ssl_verification (Boolean, nil)

    disable verification for SSL cert, helpful when you developing with a fake cert.

  • : (Boolean, true)

    include a list of user groups when getting information ont he user

  • :crowd_user_group_url (String, nil) — default: :crowd_server_url + '/rest/usermanagement/latest/user/group/direct'

    the URL to which to use for retrieving users groups optional if ‘:crowd_server_url` is specified, or if `:include_user_groups` is false required otherwise.

  • :use_sessions (Boolean, false)

    Use Crowd sessions. If the user logins with user and password create a new Crowd session. Update the session if only a session token is sent (Cookie name set by option session_cookie)

  • :session_cookie (String, 'crowd.token_key')

    Session cookie name. Defaults to: ‘crowd.token_key’

  • :sso_url (String, nil)

    URL of the external SSO page. If this parameter is defined the login form will have a link which will redirect to the SSO page. The SSO must return to the URL of the page using omniauth_crowd (Path portion ‘/users/auth/crowd/callback’ is appended to the URL)

  • :sso_url_image (String, nil)

    Optional image URL to be used in SSO link in the login form



37
38
39
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 37

def initialize(params)
  parse_params params
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def content_type
  @content_type
end

#crowd_application_nameObject (readonly)

Returns the value of attribute crowd_application_name.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def crowd_application_name
  @crowd_application_name
end

#crowd_passwordObject (readonly)

Returns the value of attribute crowd_password.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def crowd_password
  @crowd_password
end

#disable_ssl_verificationObject (readonly) Also known as: disable_ssl_verification?

Returns the value of attribute disable_ssl_verification.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def disable_ssl_verification
  @disable_ssl_verification
end

#include_users_groupsObject (readonly) Also known as: include_users_groups?

Returns the value of attribute include_users_groups.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def include_users_groups
  @include_users_groups
end

Returns the value of attribute session_cookie.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def session_cookie
  @session_cookie
end

#session_urlObject (readonly)

Returns the value of attribute session_url.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def session_url
  @session_url
end

#sso_urlObject (readonly)

Returns the value of attribute sso_url.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def sso_url
  @sso_url
end

#sso_url_imageObject (readonly)

Returns the value of attribute sso_url_image.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def sso_url_image
  @sso_url_image
end

#use_sessionsObject (readonly) Also known as: use_sessions?

Returns the value of attribute use_sessions.



13
14
15
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 13

def use_sessions
  @use_sessions
end

Instance Method Details

#authentication_url(username) ⇒ String

Build a Crowd authentication URL from username.

Parameters:

  • username (String)

    the username to validate

Returns:



46
47
48
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 46

def authentication_url(username)
  append_username @authentication_url, username
end

#user_group_url(username) ⇒ Object



50
51
52
# File 'lib/omniauth/strategies/crowd/configuration.rb', line 50

def user_group_url(username)
  @user_group_url.nil? ? nil : append_username( @user_group_url, username)
end