C# Class Rally.RestApi.Auth.ApiAuthManager

A authentication manager for a manually implemented authentication.
ファイルを表示 Open project: RallyTools/RallyRestToolkitFor.NET Class Usage Examples

Private Properties

Property Type Description
ApiAuthManager Rally.RestApi.Connection
GetProxy System.Net.WebProxy
OpenSsoPage void
PerformAuthenticationCheckAgainstIdp RallyRestApi.AuthenticationResult
PerformAuthenticationCheckAgainstRally RallyRestApi.AuthenticationResult
UpdateAuthenticationState void

Public Methods

Method Description
AutoAuthenticate ( bool allowSsoForautoAuthenticate ) : RallyRestApi.AuthenticationResult

Auto authenticates the user if there are saved credentials.

Configure ( string loginWindowTitle = null, string loginWindowHeaderLabelText = null, string loginWindowCredentialsTabText = null, string loginWindowUserNameLabelText = null, string loginWindowPwdLabelText = null, string loginWindowServerTabText = null, string loginWindowConnectionTypeText = null, string loginWindowServerLabelText = null, string loginWindowTrustAllCertificatesText = null, Uri loginWindowDefaultServer = null, string loginWindowProxyServerTabText = null, string loginWindowProxyServerLabelText = null, string loginWindowProxyUserNameLabelText = null, string loginWindowProxyPwdLabelText = null, Uri loginWindowDefaultProxyServer = null, string loginWindowSsoInProgressText = null, string loginWindowLoginButtonText = null, string loginWindowLogoutButtonText = null, string loginWindowCancelButtonText = null, string loginFailureBadServer = null, string loginFailureCredentials = null, string loginFailureLoginEmpty = null, string loginFailureServerEmpty = null, string loginFailureProxyCredentials = null, string loginFailureBadConnection = null, string loginFailureUnknown = null ) : void

Configures the authorization manger.

DeleteCachedLoginDetailsFromDisk ( ) : bool

Deletes any cached login credentials from disk.

ShowUserLoginWindow ( AuthenticationStateChange authenticationStateChange, SsoAuthenticationComplete ssoAuthenticationComplete ) : void

Authenticates the user against Rally. This must be called from the UI thread.

Protected Methods

Method Description
ApiAuthManager ( bool isUiSupported, string applicationToken, string encryptionKey, IEncryptionRoutines encryptionRoutines, string webServiceVersion = RallyRestApi.DEFAULT_WSAPI_VERSION, TraceFieldEnum traceInfo = RallyRestApi.DEFAULT_TRACE_FIELDS ) : Rally.RestApi.Connection

Constructor

NotifyLoginWindowSsoComplete ( RallyRestApi authenticationResult, RallyRestApi api ) : void

Notifies the login window that SSO has been completed.

OpenSsoPageInternal ( Uri ssoUrl ) : void

Opens the window that displays the SSO URL to the user.

PerformAuthenticationCheck ( string &errorMessage, bool allowSso = true ) : RallyRestApi.AuthenticationResult

Performs an authentication check against an identity provider (IDP Initiated).

PerformLogoutFromRally ( ) : void

Performs an logout from Rally.

ReportSsoResults ( bool success, string rallyServer, string zSessionID ) : void

Reports the results of an SSO action.

ShowUserLoginWindowInternal ( ) : void

Opens the window that displays the SSO URL to the user.

Private Methods

Method Description
ApiAuthManager ( ) : Rally.RestApi.Connection
GetProxy ( string &errorMessage ) : WebProxy

Creates the web proxy object.

OpenSsoPage ( Uri ssoUrl ) : void

Opens the specified SSO URL to the user.

PerformAuthenticationCheckAgainstIdp ( string &errorMessage ) : RallyRestApi.AuthenticationResult

Performs an authentication check against an identity provider (IDP Initiated).

PerformAuthenticationCheckAgainstRally ( string &errorMessage, bool allowSso ) : RallyRestApi.AuthenticationResult

Performs an authentication check against Rally with the specified credentials

UpdateAuthenticationState ( String errorMessage = "" ) : void

Method Details

ApiAuthManager() protected method

Constructor
protected ApiAuthManager ( bool isUiSupported, string applicationToken, string encryptionKey, IEncryptionRoutines encryptionRoutines, string webServiceVersion = RallyRestApi.DEFAULT_WSAPI_VERSION, TraceFieldEnum traceInfo = RallyRestApi.DEFAULT_TRACE_FIELDS ) : Rally.RestApi.Connection
isUiSupported bool Does this authentication manager support a UI?
applicationToken string An application token to be used as the file name to store data as (no extension needed). Each /// consuming application should use a unique name in order to ensure that the user credentials are not /// overwritten by other applications. An exception will be thrown elsewhere if this is not a valid file name.
encryptionKey string The encryption key, or salt, to be used for any encryption routines. This salt /// should be different for each user, and not the same for everyone consuming the same application. Only used /// for UI support.
encryptionRoutines IEncryptionRoutines The encryption routines to use for encryption/decryption of data. Only used for UI support.
webServiceVersion string The version of the WSAPI API to use.
traceInfo TraceFieldEnum Controls diagnostic trace information being logged
return Rally.RestApi.Connection

AutoAuthenticate() public method

Auto authenticates the user if there are saved credentials.
public AutoAuthenticate ( bool allowSsoForautoAuthenticate ) : RallyRestApi.AuthenticationResult
allowSsoForautoAuthenticate bool Is SSO authentication allowed for auto-authentication? /// This may open a web browser UI.
return RallyRestApi.AuthenticationResult

Configure() public static method

Configures the authorization manger.
public static Configure ( string loginWindowTitle = null, string loginWindowHeaderLabelText = null, string loginWindowCredentialsTabText = null, string loginWindowUserNameLabelText = null, string loginWindowPwdLabelText = null, string loginWindowServerTabText = null, string loginWindowConnectionTypeText = null, string loginWindowServerLabelText = null, string loginWindowTrustAllCertificatesText = null, Uri loginWindowDefaultServer = null, string loginWindowProxyServerTabText = null, string loginWindowProxyServerLabelText = null, string loginWindowProxyUserNameLabelText = null, string loginWindowProxyPwdLabelText = null, Uri loginWindowDefaultProxyServer = null, string loginWindowSsoInProgressText = null, string loginWindowLoginButtonText = null, string loginWindowLogoutButtonText = null, string loginWindowCancelButtonText = null, string loginFailureBadServer = null, string loginFailureCredentials = null, string loginFailureLoginEmpty = null, string loginFailureServerEmpty = null, string loginFailureProxyCredentials = null, string loginFailureBadConnection = null, string loginFailureUnknown = null ) : void
loginWindowTitle string The title to be used for the login window.
loginWindowHeaderLabelText string The header title to be used for the login window.
loginWindowCredentialsTabText string The credentials tab text to be used for the login window.
loginWindowUserNameLabelText string The user name label to be used for the login window.
loginWindowPwdLabelText string The password label to be used for the login window.
loginWindowServerTabText string The server tab label to be used for the login window.
loginWindowConnectionTypeText string The connection type label to be used for the login window.
loginWindowServerLabelText string The server label to be used for the login window.
loginWindowTrustAllCertificatesText string The trust all certificates label to be used for the login window.
loginWindowDefaultServer System.Uri The default server to be used for the login window.
loginWindowProxyServerTabText string The proxy tab label to be used for the login window.
loginWindowProxyServerLabelText string The proxy server label to be used for the login window.
loginWindowProxyUserNameLabelText string The proxy user name label to be used for the login window.
loginWindowProxyPwdLabelText string The proxy password label to be used for the login window.
loginWindowDefaultProxyServer System.Uri The default proxy server to be used for the login window.
loginWindowSsoInProgressText string The SSO in progress label to be used for the login window.
loginWindowLoginButtonText string The login button text to be used for the login window.
loginWindowLogoutButtonText string The logout button text to be used for the login window.
loginWindowCancelButtonText string The cancel button text to be used for the login window.
loginFailureBadServer string The error message to be used for when the server is bad (can't connect).
loginFailureCredentials string The error message to be used for when the credentials to Rally are bad.
loginFailureLoginEmpty string The error message to be used for when the login input field is left empty.
loginFailureServerEmpty string The error message to be used for when the server input field is left empty.
loginFailureProxyCredentials string The error message to be used for bad proxy credentials.
loginFailureBadConnection string The error message to be used for bad connection login failures.
loginFailureUnknown string The error message to be used for unknown login failures.
return void

DeleteCachedLoginDetailsFromDisk() public method

Deletes any cached login credentials from disk.
public DeleteCachedLoginDetailsFromDisk ( ) : bool
return bool

NotifyLoginWindowSsoComplete() protected abstract method

Notifies the login window that SSO has been completed.
protected abstract NotifyLoginWindowSsoComplete ( RallyRestApi authenticationResult, RallyRestApi api ) : void
authenticationResult RallyRestApi The current state of the authentication process.
api RallyRestApi The API that was authenticated against.
return void

OpenSsoPageInternal() protected abstract method

Opens the window that displays the SSO URL to the user.
protected abstract OpenSsoPageInternal ( Uri ssoUrl ) : void
ssoUrl System.Uri The URL for the SSO page to be opened.
return void

PerformAuthenticationCheck() protected method

Performs an authentication check against an identity provider (IDP Initiated).
protected PerformAuthenticationCheck ( string &errorMessage, bool allowSso = true ) : RallyRestApi.AuthenticationResult
errorMessage string The error message or any that was generated by the authentication check.
allowSso bool Is SSO allowed for this authentication check?
return RallyRestApi.AuthenticationResult

PerformLogoutFromRally() protected method

Performs an logout from Rally.
protected PerformLogoutFromRally ( ) : void
return void

ReportSsoResults() protected method

Reports the results of an SSO action.
protected ReportSsoResults ( bool success, string rallyServer, string zSessionID ) : void
success bool Was SSO authentication completed successfully?
rallyServer string The server that the ZSessionID is for.
zSessionID string The zSessionID that was returned from Rally.
return void

ShowUserLoginWindow() public method

Authenticates the user against Rally. This must be called from the UI thread.
public ShowUserLoginWindow ( AuthenticationStateChange authenticationStateChange, SsoAuthenticationComplete ssoAuthenticationComplete ) : void
authenticationStateChange AuthenticationStateChange The delegate to call when an authentication state change occurs.
ssoAuthenticationComplete SsoAuthenticationComplete The delegate to call when an authentication state change occurs due to SSO.
return void

ShowUserLoginWindowInternal() protected abstract method

Opens the window that displays the SSO URL to the user.
protected abstract ShowUserLoginWindowInternal ( ) : void
return void