| Package | com.esri.ags.components |
| Class | public class IdentityManager |
| Inheritance | IdentityManager flash.events.EventDispatcher |
| Since : | ArcGIS API 3.0 for Flex |
Note: Requires ArcGIS 10 SP1 for Server or later.
See also
| Property | Defined By | ||
|---|---|---|---|
| currentSignInInfo : SignInInfo [read-only]
The information that can be used by a sign in window when the Identity Manager
is challenging the user for their username and password. | IdentityManager | ||
| enabled : Boolean
Set to true to enable the Identity Manager. | IdentityManager | ||
| instance : IdentityManager [static] [read-only]
The single IdentityManager instance. | IdentityManager | ||
| signInWindowClass : Class
The class to be created and shown using the PopUpManager so the user can log in. | IdentityManager | ||
| Method | Defined By | ||
|---|---|---|---|
findCredential(url:String, userId:String = null):Credential
Returns the credential for the resource identified by the specified url. | IdentityManager | ||
findServerInfo(url:String):ServerInfo
Returns information about the server that is hosting the specified url. | IdentityManager | ||
generateCredential(serverInfo:ServerInfo, username:String, password:String, responder:IResponder = null):AsyncToken
Returns a Credential object containing a token and its expiration time. | IdentityManager | ||
getCredential(url:String, retry:Boolean = false, responder:IResponder = null):AsyncToken
Returns a Credential object that can be used to access the secured resource identified by the input url. | IdentityManager | ||
registerServers(serverInfos:Array):void
Register secure servers and the token endpoints. | IdentityManager | ||
setCredentialForCurrentSignIn(credential:Credential):void
Called by the sign-in window to provide a valid credential for the current resource. | IdentityManager | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Fires when the Identity Manager is about to challenge the user for their username and password. | IdentityManager | |||
| currentSignInInfo | property |
currentSignInInfo:SignInInfo [read-only] The information that can be used by a sign in window when the Identity Manager is challenging the user for their username and password.
public function get currentSignInInfo():SignInInfo| enabled | property |
enabled:BooleanSet to true to enable the Identity Manager.
The default value is false.
This property can be used as the source for data binding.
public function get enabled():Boolean public function set enabled(value:Boolean):voidIdentityManager.instance.enabled = true;
| instance | property |
instance:IdentityManager [read-only] The single IdentityManager instance.
public static function get instance():IdentityManager| signInWindowClass | property |
public var signInWindowClass:ClassThe class to be created and shown using the PopUpManager so the user can log in.
Note: All the source code for the skins can be found in the ArcGIS API for Flex download. Once you unzip the api you can find the skins under the following directory 'ArcGIS_Flex/skins/src/com/esri/ags/skins' and the skin assets in the directory 'ArcGIS_Flex/skins/src/assets/skins'.
Copy the SignInWindow class to a project folder such as
mySkins/supportClasses, rename such as CustomSignInWindow,
and customize it as you see fit then set the signInWindowClass property
on the IdentityManager class.
The default value is com.esri.ags.skins.supportClasses.SignInWindow.
IdentityManager.instance.signInWindowClass = mySkins.supportClasses.CustomSignInWindow;
| findCredential | () | method |
public function findCredential(url:String, userId:String = null):CredentialReturns the credential for the resource identified by the specified url. Optionally you can provide a userId to find credentials for a specific user.
Parameters
url:String — The url to a server.
| |
userId:String (default = null) — The userId for which you want to obtain credentials.
|
Credential — the credential or null if not found.
|
| findServerInfo | () | method |
public function findServerInfo(url:String):ServerInfoReturns information about the server that is hosting the specified url.
Parameters
url:String — The url to a server.
|
ServerInfo — the server info.
|
| generateCredential | () | method |
public function generateCredential(serverInfo:ServerInfo, username:String, password:String, responder:IResponder = null):AsyncTokenReturns a Credential object containing a token and its expiration time. You need to provide the ServerInfo object that contains token service URL and a username and password. This is a helper method typically called by sign-in windows to generate tokens.
Parameters
serverInfo:ServerInfo — A ServerInfo object that contains a token service URL.
| |
username:String — The user's username.
| |
password:String — The user's password.
| |
responder:IResponder (default = null) — The responder to call on result or fault.
|
AsyncToken —
|
See also
| getCredential | () | method |
public function getCredential(url:String, retry:Boolean = false, responder:IResponder = null):AsyncTokenReturns a Credential object that can be used to access the secured resource identified by the input url. If required the user will be challenged for a username and password which is used to generate a token. Note: The Identity Manager sets up a timer to update the Credential object with a new token prior to the expiration time. This method is typically called by the BaseTask when a request fails due to an "invalid credentials" error.
Parameters
url:String — The url for the secure resource.
| |
retry:Boolean (default = false) — Determines if the method should make an additional attempt to get the credential after a failure.
| |
responder:IResponder (default = null) — The responder to call on result or fault.
|
AsyncToken —
|
See also
| registerServers | () | method |
public function registerServers(serverInfos:Array):voidRegister secure servers and the token endpoints. The Identity Manager uses the rest/info resource to determine the location of the token endpoint so in most cases calling registerServers is not necessary. However if the location of your server or token endpoint is non-standard, then use this method to register the location.
Parameters
serverInfos:Array — An Array of ServerInfo objects that defines the secure service and token endpoint.
|
See also
| setCredentialForCurrentSignIn | () | method |
public function setCredentialForCurrentSignIn(credential:Credential):voidCalled by the sign-in window to provide a valid credential for the current resource. The sign-in window should pass in null if it's unable to generate a valid credential.
Parameters
credential:Credential — the credential for the current resource or null if one
can not be provided.
|
See also
| showSignInWindow | Event |
com.esri.ags.events.IdentityManagerEventcom.esri.ags.events.IdentityManagerEvent.SHOW_SIGN_IN_WINDOWFires when the Identity Manager is about to challenge the user for their username and password. This event is cancelable by calling event.preventDefault() which will stop the signInWindowClass from being opened. It's then the application's responsibility to challenge the user and call setCredentialForCurrentSignIn().
Defines the value of thetype property of an showSignInWindow event object.
See also