pub struct Client { /* private fields */ }
Expand description
Client for AWS SSO OIDC
Client for invoking operations on AWS SSO OIDC. Each operation on AWS SSO OIDC is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateToken
operation has
a Client::create_token
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_token()
.client_id("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn create_token(&self) -> CreateTokenFluentBuilder
pub fn create_token(&self) -> CreateTokenFluentBuilder
Constructs a fluent builder for the CreateToken
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe unique identifier string for the client or application. This value comes from the result of the
RegisterClient
API.client_secret(impl Into<String>)
/set_client_secret(Option<String>)
:
required: trueA secret string generated for the client. This value should come from the persisted result of the
RegisterClient
API.grant_type(impl Into<String>)
/set_grant_type(Option<String>)
:
required: trueSupports the following OAuth grant types: Device Code and Refresh Token. Specify either of the following values, depending on the grant type that you want:
* Device Code -
urn:ietf:params:oauth:grant-type:device_code
* Refresh Token -
refresh_token
For information about how to obtain the device code, see the
StartDeviceAuthorization
topic.device_code(impl Into<String>)
/set_device_code(Option<String>)
:
required: falseUsed only when calling this API for the Device Code grant type. This short-term code is used to identify this authorization request. This comes from the result of the
StartDeviceAuthorization
API.code(impl Into<String>)
/set_code(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. The short-term code is used to identify this authorization request. This grant type is currently unsupported for the
CreateToken
API.refresh_token(impl Into<String>)
/set_refresh_token(Option<String>)
:
required: falseUsed only when calling this API for the Refresh Token grant type. This token is used to refresh short-term tokens, such as the access token, that might expire.
For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
scope(impl Into<String>)
/set_scope(Option<Vec::<String>>)
:
required: falseThe list of scopes for which authorization is requested. The access token that is issued is limited to the scopes that are granted. If this value is not specified, IAM Identity Center authorizes all scopes that are configured for the client during the call to
RegisterClient
.redirect_uri(impl Into<String>)
/set_redirect_uri(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. This value specifies the location of the client or application that has registered to receive the authorization code.
- On success, responds with
CreateTokenOutput
with field(s):access_token(Option<String>)
:A bearer token to access AWS accounts and applications assigned to a user.
token_type(Option<String>)
:Used to notify the client that the returned token is an access token. The supported token type is
Bearer
.expires_in(i32)
:Indicates the time in seconds when an access token will expire.
refresh_token(Option<String>)
:A token that, if present, can be used to refresh a previously issued access token that might have expired.
For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
id_token(Option<String>)
:The
idToken
is not implemented or supported. For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.A JSON Web Token (JWT) that identifies who is associated with the issued access token.
- On failure, responds with
SdkError<CreateTokenError>
Source§impl Client
impl Client
Sourcepub fn create_token_with_iam(&self) -> CreateTokenWithIAMFluentBuilder
pub fn create_token_with_iam(&self) -> CreateTokenWithIAMFluentBuilder
Constructs a fluent builder for the CreateTokenWithIAM
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe unique identifier string for the client or application. This value is an application ARN that has OAuth grants configured.
grant_type(impl Into<String>)
/set_grant_type(Option<String>)
:
required: trueSupports the following OAuth grant types: Authorization Code, Refresh Token, JWT Bearer, and Token Exchange. Specify one of the following values, depending on the grant type that you want:
* Authorization Code -
authorization_code
* Refresh Token -
refresh_token
* JWT Bearer -
urn:ietf:params:oauth:grant-type:jwt-bearer
* Token Exchange -
urn:ietf:params:oauth:grant-type:token-exchange
code(impl Into<String>)
/set_code(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. This short-term code is used to identify this authorization request. The code is obtained through a redirect from IAM Identity Center to a redirect URI persisted in the Authorization Code GrantOptions for the application.
refresh_token(impl Into<String>)
/set_refresh_token(Option<String>)
:
required: falseUsed only when calling this API for the Refresh Token grant type. This token is used to refresh short-term tokens, such as the access token, that might expire.
For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
assertion(impl Into<String>)
/set_assertion(Option<String>)
:
required: falseUsed only when calling this API for the JWT Bearer grant type. This value specifies the JSON Web Token (JWT) issued by a trusted token issuer. To authorize a trusted token issuer, configure the JWT Bearer GrantOptions for the application.
scope(impl Into<String>)
/set_scope(Option<Vec::<String>>)
:
required: falseThe list of scopes for which authorization is requested. The access token that is issued is limited to the scopes that are granted. If the value is not specified, IAM Identity Center authorizes all scopes configured for the application, including the following default scopes:
openid
,aws
,sts:identity_context
.redirect_uri(impl Into<String>)
/set_redirect_uri(Option<String>)
:
required: falseUsed only when calling this API for the Authorization Code grant type. This value specifies the location of the client or application that has registered to receive the authorization code.
subject_token(impl Into<String>)
/set_subject_token(Option<String>)
:
required: falseUsed only when calling this API for the Token Exchange grant type. This value specifies the subject of the exchange. The value of the subject token must be an access token issued by IAM Identity Center to a different client or application. The access token must have authorized scopes that indicate the requested application as a target audience.
subject_token_type(impl Into<String>)
/set_subject_token_type(Option<String>)
:
required: falseUsed only when calling this API for the Token Exchange grant type. This value specifies the type of token that is passed as the subject of the exchange. The following value is supported:
* Access Token -
urn:ietf:params:oauth:token-type:access_token
requested_token_type(impl Into<String>)
/set_requested_token_type(Option<String>)
:
required: falseUsed only when calling this API for the Token Exchange grant type. This value specifies the type of token that the requester can receive. The following values are supported:
* Access Token -
urn:ietf:params:oauth:token-type:access_token
* Refresh Token -
urn:ietf:params:oauth:token-type:refresh_token
- On success, responds with
CreateTokenWithIamOutput
with field(s):access_token(Option<String>)
:A bearer token to access AWS accounts and applications assigned to a user.
token_type(Option<String>)
:Used to notify the requester that the returned token is an access token. The supported token type is
Bearer
.expires_in(i32)
:Indicates the time in seconds when an access token will expire.
refresh_token(Option<String>)
:A token that, if present, can be used to refresh a previously issued access token that might have expired.
For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see Considerations for Using this Guide in the IAM Identity Center OIDC API Reference.
id_token(Option<String>)
:A JSON Web Token (JWT) that identifies the user associated with the issued access token.
issued_token_type(Option<String>)
:Indicates the type of tokens that are issued by IAM Identity Center. The following values are supported:
* Access Token -
urn:ietf:params:oauth:token-type:access_token
* Refresh Token -
urn:ietf:params:oauth:token-type:refresh_token
scope(Option<Vec::<String>>)
:The list of scopes for which authorization is granted. The access token that is issued is limited to the scopes that are granted.
- On failure, responds with
SdkError<CreateTokenWithIAMError>
Source§impl Client
impl Client
Sourcepub fn register_client(&self) -> RegisterClientFluentBuilder
pub fn register_client(&self) -> RegisterClientFluentBuilder
Constructs a fluent builder for the RegisterClient
operation.
- The fluent builder is configurable:
client_name(impl Into<String>)
/set_client_name(Option<String>)
:
required: trueThe friendly name of the client.
client_type(impl Into<String>)
/set_client_type(Option<String>)
:
required: trueThe type of client. The service supports only
public
as a client type. Anything other than public will be rejected by the service.scopes(impl Into<String>)
/set_scopes(Option<Vec::<String>>)
:
required: falseThe list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.
- On success, responds with
RegisterClientOutput
with field(s):client_id(Option<String>)
:The unique identifier string for each client. This client uses this identifier to get authenticated by the service in subsequent calls.
client_secret(Option<String>)
:A secret string generated for the client. The client will use this string to get authenticated by the service in subsequent calls.
client_id_issued_at(i64)
:Indicates the time at which the
clientId
andclientSecret
were issued.client_secret_expires_at(i64)
:Indicates the time at which the
clientId
andclientSecret
will become invalid.authorization_endpoint(Option<String>)
:An endpoint that the client can use to request authorization.
token_endpoint(Option<String>)
:An endpoint that the client can use to create tokens.
- On failure, responds with
SdkError<RegisterClientError>
Source§impl Client
impl Client
Constructs a fluent builder for the StartDeviceAuthorization
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:
required: trueThe unique identifier string for the client that is registered with IAM Identity Center. This value should come from the persisted result of the
RegisterClient
API operation.client_secret(impl Into<String>)
/set_client_secret(Option<String>)
:
required: trueA secret string that is generated for the client. This value should come from the persisted result of the
RegisterClient
API operation.start_url(impl Into<String>)
/set_start_url(Option<String>)
:
required: trueThe URL for the Amazon Web Services access portal. For more information, see Using the Amazon Web Services access portal in the IAM Identity Center User Guide.
- On success, responds with
StartDeviceAuthorizationOutput
with field(s):device_code(Option<String>)
:The short-lived code that is used by the device when polling for a session token.
user_code(Option<String>)
:A one-time user verification code. This is needed to authorize an in-use device.
verification_uri(Option<String>)
:The URI of the verification page that takes the
userCode
to authorize the device.verification_uri_complete(Option<String>)
:An alternate URL that the client can use to automatically launch a browser. This process skips the manual step in which the user visits the verification page and enters their code.
expires_in(i32)
:Indicates the number of seconds in which the verification code will become invalid.
interval(i32)
:Indicates the number of seconds the client must wait between attempts when polling for a session.
- On failure, responds with
SdkError<StartDeviceAuthorizationError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)