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.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_ssooidc::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */
Constructing a client with custom configuration
use aws_config::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_ssooidc::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_ssooidc::Client::from_conf(config);
Implementations
sourceimpl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
Creates a client with the given service configuration.
sourceimpl Client
impl Client
sourcepub fn create_token(&self) -> CreateToken
pub fn create_token(&self) -> CreateToken
Constructs a fluent builder for the CreateToken
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:The unique identifier string for each client. This value should come from the persisted result of the
RegisterClient
API.client_secret(impl Into<String>)
/set_client_secret(Option<String>)
:A 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>)
:Supports grant types for authorization code, refresh token, and device code request.
device_code(impl Into<String>)
/set_device_code(Option<String>)
:Used only when calling this API for the device code grant type. This short-term code is used to identify this authentication attempt. This should come from an in-memory reference to the result of the
StartDeviceAuthorization
API.code(impl Into<String>)
/set_code(Option<String>)
:The authorization code received from the authorization service. This parameter is required to perform an authorization grant request to get access to a token.
refresh_token(impl Into<String>)
/set_refresh_token(Option<String>)
:The token used to obtain an access token in the event that the access token is invalid or expired. This token is not issued by the service.
scope(Vec<String>)
/set_scope(Option<Vec<String>>)
:The list of scopes that is defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.
redirect_uri(impl Into<String>)
/set_redirect_uri(Option<String>)
:The location of the application that will receive the authorization code. Users authorize the service to send the request to this location.
- On success, responds with
CreateTokenOutput
with field(s):access_token(Option<String>)
:An opaque token to access AWS SSO resources assigned to a user.
token_type(Option<String>)
:Used to notify the client that the returned token is an access token. The supported type is
BearerToken
.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.
id_token(Option<String>)
:The identifier of the user that associated with the access token, if present.
- On failure, responds with
SdkError<CreateTokenError>
sourcepub fn register_client(&self) -> RegisterClient
pub fn register_client(&self) -> RegisterClient
Constructs a fluent builder for the RegisterClient
operation.
- The fluent builder is configurable:
client_name(impl Into<String>)
/set_client_name(Option<String>)
:The friendly name of the client.
client_type(impl Into<String>)
/set_client_type(Option<String>)
:The type of client. The service supports only
public
as a client type. Anything other than public will be rejected by the service.scopes(Vec<String>)
/set_scopes(Option<Vec<String>>)
:The 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>)
:The endpoint where the client can request authorization.
token_endpoint(Option<String>)
:The endpoint where the client can get an access token.
- On failure, responds with
SdkError<RegisterClientError>
Constructs a fluent builder for the StartDeviceAuthorization
operation.
- The fluent builder is configurable:
client_id(impl Into<String>)
/set_client_id(Option<String>)
:The unique identifier string for the client that is registered with AWS SSO. This value should come from the persisted result of the
RegisterClient
API operation.client_secret(impl Into<String>)
/set_client_secret(Option<String>)
:A 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>)
:The URL for the AWS SSO user portal. For more information, see Using the User Portal in the AWS Single Sign-On 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>
sourceimpl Client
impl Client
sourcepub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
pub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
Creates a client with the given service config and connector override.
Trait Implementations
sourceimpl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
impl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
sourcefn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
fn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more