Struct yup_oauth2::authenticator::AuthenticatorBuilder [−][src]
pub struct AuthenticatorBuilder<C, F> { /* fields omitted */ }
Expand description
Configure an Authenticator using the builder pattern.
Implementations
Methods available when building any Authenticator.
let authenticator = yup_oauth2::DeviceFlowAuthenticator::builder(app_secret)
.hyper_client(custom_hyper_client)
.persist_tokens_to_disk("/tmp/tokenfile.json")
.build()
.await
.expect("failed to create authenticator");
Use the provided token storage mechanism
pub fn hyper_client<NewC>(
self,
hyper_client: Client<NewC>
) -> AuthenticatorBuilder<Client<NewC>, F>
pub fn hyper_client<NewC>(
self,
hyper_client: Client<NewC>
) -> AuthenticatorBuilder<Client<NewC>, F>
Use the provided hyper client.
Persist tokens to disk in the provided filename.
Methods available when building a device flow Authenticator.
let authenticator = yup_oauth2::DeviceFlowAuthenticator::builder(app_secret)
.device_code_url("foo")
.flow_delegate(Box::new(custom_flow_delegate))
.grant_type("foo")
.build()
.await
.expect("failed to create authenticator");
Use the provided device code url.
Use the provided DeviceFlowDelegate.
Use the provided grant type.
Create the authenticator.
Methods available when building an installed flow Authenticator.
let authenticator = yup_oauth2::InstalledFlowAuthenticator::builder(
app_secret,
InstalledFlowReturnMethod::HTTPRedirect,
)
.flow_delegate(Box::new(custom_flow_delegate))
.build()
.await
.expect("failed to create authenticator");
Use the provided InstalledFlowDelegate.
Create the authenticator.
Methods available when building a service account authenticator.
let authenticator = yup_oauth2::ServiceAccountAuthenticator::builder(
service_account_key,
)
.subject("mysubject")
.build()
.await
.expect("failed to create authenticator");
Create the authenticator.