pub struct IncompleteAuthorizationCodeUserClient<C>where
C: HttpClient + Clone,{ /* private fields */ }async or sync only.Expand description
An incomplete authorization code user client.
The client has been configured, and it has to be finalized by directing the user to the authorize URL and retrieving an authorization code and a state parameter from the redirect callback URL.
Implementations§
Source§impl<C> IncompleteAuthorizationCodeUserClient<C>where
C: HttpClient + Clone,
impl<C> IncompleteAuthorizationCodeUserClient<C>where
C: HttpClient + Clone,
Returns an authorization URL the user should be directed to in some manner.
Once the user approves the application, they are redirected back to the application’s callback URL. The URL
query in the callback will contain a code parameter and a state parameter, which should be passed to the
finalize-function in order to complete the client and get
an AuthorizationCodeUserClient.
Source§impl IncompleteAuthorizationCodeUserClient<AsyncClient>
impl IncompleteAuthorizationCodeUserClient<AsyncClient>
Sourcepub async fn finalize(
self,
code: &str,
state: &str,
) -> Result<AsyncAuthorizationCodeUserClient>
Available on crate feature async only.
pub async fn finalize( self, code: &str, state: &str, ) -> Result<AsyncAuthorizationCodeUserClient>
async only.Finalize this client with a code and a state from the callback URL query the user was redirected to after they approved the application and return an usable AuthorizationCodeUserClient.
This function will use the authorization code to request an access and a refresh token from Spotify. If the
originally generated state does not match the state parameter, the function will return an
AuthorizationCodeStateMismatch-error.
Source§impl IncompleteAuthorizationCodeUserClient<SyncClient>
impl IncompleteAuthorizationCodeUserClient<SyncClient>
Sourcepub fn finalize(
self,
code: &str,
state: &str,
) -> Result<SyncAuthorizationCodeUserClient>
Available on crate feature sync only.
pub fn finalize( self, code: &str, state: &str, ) -> Result<SyncAuthorizationCodeUserClient>
sync only.Finalize this client with a code and a state from the callback URL query the user was redirected to after they approved the application and return an usable AuthorizationCodeUserClient.
This function will use the authorization code to request an access and a refresh token from Spotify. If the
originally generated state does not match the state parameter, the function will return an
AuthorizationCodeStateMismatch-error.