async fn handle_get_access_token(
        &self,
        app_config: AppConfig,
        refresh_token: String,
        app_scopes: Vec<String>,
        cache_key: AccessTokenKey,
    ) -> TokenManagerResult<Arc<OAuthToken>> {
        let auth_provider_type = &app_config.auth_provider_type;
        let auth_provider_proxy = await!(self.get_auth_provider_proxy(auth_provider_type))?;

        let (status, provider_token) = await!(auth_provider_proxy.get_app_access_token(
            &refresh_token,
            app_config.client_id.as_ref().map(|x| &**x),
            &mut app_scopes.iter().map(|x| &**x),
        ))
        .map_err(|err| {
            self.discard_auth_provider_proxy(auth_provider_type);
            TokenManagerError::new(Status::AuthProviderServerError).with_cause(err)
        })?;

        let provider_token = provider_token.ok_or(TokenManagerError::from(status))?;
        let native_token = Arc::new(OAuthToken::from(*provider_token));
        self.token_cache.lock().put(cache_key, Arc::clone(&native_token));
        Ok(native_token)
    }
/// Implements the FIDL TokenManager.GetAccessToken method using an auth provider that does not
/// support IoT ID.
Implements the FIDL TokenManager.GetAccessToken method using an auth provider that does not
support IoT ID.
Implements the FIDL TokenManager . GetAccessToken method using an auth provider that does not support IoT ID .
async fn handle_get_access_token(
        &self,
        app_config: AppConfig,
        refresh_token: String,
        app_scopes: Vec<String>,
        cache_key: AccessTokenKey,
    ) -> TokenManagerResult<Arc<OAuthToken>> {
        let auth_provider_type = &app_config.auth_provider_type;
        let auth_provider_proxy = await!(self.get_auth_provider_proxy(auth_provider_type))?;
        let (status, provider_token) = await!(auth_provider_proxy.get_app_access_token(
            &refresh_token,
            app_config.client_id.as_ref().map(|x| &**x),
            &mut app_scopes.iter().map(|x| &**x),
        ))
        .map_err(|err| {
            self.discard_auth_provider_proxy(auth_provider_type);
            TokenManagerError::new(Status::AuthProviderServerError).with_cause(err)
        })?;
        let provider_token = provider_token.ok_or(TokenManagerError::from(status))?;
        let native_token = Arc::new(OAuthToken::from(*provider_token));
        self.token_cache.lock().put(cache_key, Arc::clone(&native_token));
        Ok(native_token)
    }
async fn handle_get_access_token ( & self , app_config : AppConfig , refresh_token : String , app_scopes : Vec < String > , cache_key : AccessTokenKey , ) -> TokenManagerResult < Arc < OAuthToken > > { let auth_provider_type = & app_config . auth_provider_type ; let auth_provider_proxy = await ! ( self get_auth_provider_proxy ( auth_provider_type ) ) ? ; let ( status , provider_token ) = await ! ( auth_provider_proxy get_app_access_token ( refresh_token app_config client_id as_ref ( ) map ( x x ) mut app_scopes iter ( ) map ( x x ) ) ) . map_err ( | err | { self . discard_auth_provider_proxy ( auth_provider_type ) ; TokenManagerError :: new ( Status :: AuthProviderServerError ) . with_cause ( err ) } ) ? ; let provider_token = provider_token . ok_or ( TokenManagerError :: from ( status ) ) ? ; let native_token = Arc :: new ( OAuthToken :: from ( * provider_token ) ) ; self . token_cache . lock ( ) . put ( cache_key , Arc :: clone ( & native_token ) ) ; Ok ( native_token ) }
Implements the FIDL TokenManager.GetAccessToken method using an auth provider that does not
support IoT ID.
Implements the FIDL TokenManager . GetAccessToken method using an auth provider that does not support IoT ID .
&self
app_config
AppConfig
refresh_token
String
app_scopes
Vec<String>
cache_key
AccessTokenKey
&self
app_config
AppConfig
refresh_token
String
app_scopes
Vec<String>
cache_key
AccessTokenKey