

# CompleteOAuthSessionBinding

Completes a consent session. Call this from the handler at your session-binding URL, over a session carrying the same end-user identity that started the flow. On a match the broker obtains the token and holds it for later retrieval. On a mismatch it fails with AccessDeniedException and reason SESSION\_BINDING\_IDENTITY\_MISMATCH, and no token is kept.

## Request Syntax
<a name="API_CompleteOAuthSessionBinding_RequestSyntax"></a>

```
POST /CompleteOAuthSessionBinding HTTP/1.1
Content-type: application/json

{
   "sessionUri": "{{string}}"
}
```

## URI Request Parameters
<a name="API_CompleteOAuthSessionBinding_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_CompleteOAuthSessionBinding_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [sessionUri](#API_CompleteOAuthSessionBinding_RequestSyntax) **   <a name="credentialbroker-CompleteOAuthSessionBinding-request-sessionUri"></a>
The session handle from StartOAuthSession.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1024.  
Pattern: `urn:ietf:params:oauth:request_uri:[a-zA-Z0-9-._~]+`   
Required: Yes

## Response Syntax
<a name="API_CompleteOAuthSessionBinding_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "sessionUri": "string"
}
```

## Response Elements
<a name="API_CompleteOAuthSessionBinding_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [sessionUri](#API_CompleteOAuthSessionBinding_ResponseSyntax) **   <a name="credentialbroker-CompleteOAuthSessionBinding-response-sessionUri"></a>
Echoes the bound session handle.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1024.  
Pattern: `urn:ietf:params:oauth:request_uri:[a-zA-Z0-9-._~]+` 

## Errors
<a name="API_CompleteOAuthSessionBinding_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
The caller is not authorized to perform the request, or a resource the request depends on refused access. `reason` distinguishes a denial by this service from a denial reported by a dependency the caller configured, such as a customer-owned secret, KMS key, or external identity provider, which usually points at a permission or configuration fix outside this API.  
HTTP Status Code: 403

 ** ConflictException **   
The request conflicts with the current state of the resource. Nothing was changed. Depending on `reason`, the request may succeed if retried once the resource reaches a settled state, or it may require different input (for example a name that is not already taken).    
 ** resourceId **   
The identifier of the resource the request conflicted with, when the service attributes the conflict to a single resource.  
 ** resourceType **   
The type of the resource named by `resourceId`, when present.
HTTP Status Code: 409

 ** InternalServerException **   
The request failed because of an unexpected error in the service. Whether the request took effect is undefined, so for a create or update, read the resource back before retrying. Retryable: the same request may succeed later.    
 ** retryAfterSeconds **   
The number of seconds to wait before retrying. If this field is absent, retry with exponential backoff.
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The requested resource does not exist, or the caller is not permitted to know that it exists. A resource that was deleted, or that is still being created, can also be reported this way.    
 ** resourceId **   
The identifier of the resource that could not be found, echoed from the request.  
 ** resourceType **   
The type of the resource named by `resourceId`, when present.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
A downstream dependency the broker relies on is temporarily unavailable, notably the customer's external IdP token/discovery endpoint (upstream 5xx, `server_error`, or `temporarily_unavailable`). Retryable: the same request may succeed later.    
 ** retryAfterSeconds **   
The number of seconds to wait before retrying. If this field is absent, retry with exponential backoff.
HTTP Status Code: 503

 ** ThrottlingException **   
The request was denied because the caller exceeded a request rate limit. Nothing was changed. Retry with exponential backoff, honoring `retryAfterSeconds` when it is present.    
 ** retryAfterSeconds **   
The number of seconds to wait before retrying. If this field is absent, retry with exponential backoff.
HTTP Status Code: 429

 ** ValidationException **   
The request is not valid. The request was rejected before any change was made, so it is safe to correct the input and retry. Use `reason` to branch in code and `message` for the human-readable detail of which field or combination of fields was at fault.  
HTTP Status Code: 400

## See Also
<a name="API_CompleteOAuthSessionBinding_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/credentialbroker-2026-07-01/CompleteOAuthSessionBinding) 