GetLoginProfile - AWS Identity and Access Management

GetLoginProfile

Retrieves the user name for the specified IAM user. A login profile is created when you create a password for the user to access the AWS Management Console. If the user does not exist or does not have a password, the operation returns a 404 (NoSuchEntity) error.

If you create an IAM user with access to the console, the CreateDate reflects the date you created the initial password for the user.

If you create an IAM user with programmatic access, and then later add a password for the user to access the AWS Management Console, the CreateDate reflects the initial password creation date. A user with programmatic access does not have a login profile unless you create a password for the user to access the AWS Management Console.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

UserName

The name of the user whose login profile you want to retrieve.

This parameter is optional. If no user name is included, it defaults to the principal making the request. When you make this request with root user credentials, you must use an AssumeRoot session to omit the user name.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [\w+=,.@-]+

Required: No

Response Elements

The following element is returned by the service.

LoginProfile

A structure containing the user name and the profile creation date for the user.

Type: LoginProfile object

Errors

For information about the errors that are common to all actions, see Common Errors.

NoSuchEntity

The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

HTTP Status Code: 404

ServiceFailure

The request processing has failed because of an unknown error, exception or failure.

HTTP Status Code: 500

Examples

Example

This example illustrates one usage of GetLoginProfile.

Sample Request

https://iam.amazonaws.com/?Action=GetLoginProfile &UserName=Bob &AUTHPARAMS

Sample Response

<GetLoginProfileResponse> <GetLoginProfileResult> <LoginProfile> <UserName>Bob</UserName> <CreateDate>2011-09-19T23:00:56Z</CreateDate> </LoginProfile> </GetLoginProfileResult> <ResponseMetadata> <RequestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestId> </ResponseMetadata> </GetLoginProfileResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: