Struct aws_sdk_ssooidc::Client

source ·
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

source

pub fn create_token(&self) -> CreateTokenFluentBuilder

Constructs a fluent builder for the CreateToken operation.

source§

impl Client

source

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: true

      The 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: true

      Supports 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: false

      Used 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: false

      Used 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: false

      Used 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: false

      The 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: false

      Used 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: false

      Used 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: false

      Used 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: false

      Used 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

source

pub fn register_client(&self) -> RegisterClientFluentBuilder

Constructs a fluent builder for the RegisterClient operation.

source§

impl Client

source

pub fn start_device_authorization( &self ) -> StartDeviceAuthorizationFluentBuilder

Constructs a fluent builder for the StartDeviceAuthorization operation.

source§

impl Client

source

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 and time_source configured.
  • No behavior_version is provided.

The panic message for each of these will have instructions on how to resolve them.

source

pub fn config(&self) -> &Config

Returns the client’s configuration.

source§

impl Client

source

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 the sleep_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 the http_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, set behavior_version on the Config or enable the behavior-version-latest Cargo feature.

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more