Reputation: 773
How can I access the Principal object in a Flex client that was returned by the doAuthenticate()
method in the LoginCommand?
Adobe's LCDS Custom Authentication page isn't much help in this matter, as this is the only example they show for a successful login:
// Handle successful login.
private function LoginResultEvent(event:ResultEvent, token:Object=null):void {
switch(event.result) {
case "success":
authenticatedCB.selected = true;
break;
default:
}
}
I can return a strongly typed object as the Principal from the doAuthenticate()
method, but how do I access it in the client's result handler?
Update: I've read the LCDS documentation twice now and there is no mention of accessing the Principal in the client. The only data I can retrieve from a result is the string 'success'. Anyone know if this is this the only result available from a custom authentication?
Upvotes: 0
Views: 305
Reputation: 29300
Generally, I use a 2nd call after a successful login, which returns the principle.
Eg.,
public User getCurrentUser()
Takes no params (username,password), as they're already available in the security context.
Upvotes: 1