| 144 | } |
| 145 | |
| 146 | async fn create_token(&self, args: CreateTokenArgs) -> Result<CreateTokenResponse, AuthError> { |
| 147 | let output = self |
| 148 | .create_token() |
| 149 | .client_id(args.client_id.clone()) |
| 150 | .client_secret(args.client_secret.clone()) |
| 151 | .grant_type("authorization_code") |
| 152 | .redirect_uri(args.redirect_uri) |
| 153 | .code_verifier(args.code_verifier) |
| 154 | .code(args.code) |
| 155 | .send() |
| 156 | .await?; |
| 157 | Ok(CreateTokenResponse { output }) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | /// Represents an active PKCE registration flow. To execute the flow, you should (in order): |