# OAuth2CredentialProviderAttributes

Struct · Stable

Attributes for importing an existing OAuth2 credential provider.

Used as argument in: [OAuth2CredentialProvider.fromOAuth2CredentialProviderAttributes](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.OAuth2CredentialProvider.html#fromoauth2credentialproviderattributes)

- Source: [`aws-bedrockagentcore/lib/identity/oauth2-credential-provider.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/identity/oauth2-credential-provider.ts#L508)
- Type last changed: v2.255.0 · 19 May 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';
const oAuth2CredentialProviderAttributes: bedrockagentcore.OAuth2CredentialProviderAttributes = {
  credentialProviderArn: 'credentialProviderArn',
  credentialProviderVendor: 'credentialProviderVendor',

  // the properties below are optional
  callbackUrl: 'callbackUrl',
  clientSecretArn: 'clientSecretArn',
  createdTime: 'createdTime',
  lastUpdatedTime: 'lastUpdatedTime',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrockagentcore as bedrockagentcore

o_auth2_credential_provider_attributes = bedrockagentcore.OAuth2CredentialProviderAttributes(
    credential_provider_arn="credentialProviderArn",
    credential_provider_vendor="credentialProviderVendor",

    # the properties below are optional
    callback_url="callbackUrl",
    client_secret_arn="clientSecretArn",
    created_time="createdTime",
    last_updated_time="lastUpdatedTime"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrockagentcore.*;

OAuth2CredentialProviderAttributes oAuth2CredentialProviderAttributes = OAuth2CredentialProviderAttributes.builder()
        .credentialProviderArn("credentialProviderArn")
        .credentialProviderVendor("credentialProviderVendor")

        // the properties below are optional
        .callbackUrl("callbackUrl")
        .clientSecretArn("clientSecretArn")
        .createdTime("createdTime")
        .lastUpdatedTime("lastUpdatedTime")
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.BedrockAgentCore;

var oAuth2CredentialProviderAttributes = new OAuth2CredentialProviderAttributes {
    CredentialProviderArn = "credentialProviderArn",
    CredentialProviderVendor = "credentialProviderVendor",

    // the properties below are optional
    CallbackUrl = "callbackUrl",
    ClientSecretArn = "clientSecretArn",
    CreatedTime = "createdTime",
    LastUpdatedTime = "lastUpdatedTime"
};
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

oAuth2CredentialProviderAttributes := &OAuth2CredentialProviderAttributes{
	CredentialProviderArn: jsii.String("credentialProviderArn"),
	CredentialProviderVendor: jsii.String("credentialProviderVendor"),

	// the properties below are optional
	CallbackUrl: jsii.String("callbackUrl"),
	ClientSecretArn: jsii.String("clientSecretArn"),
	CreatedTime: jsii.String("createdTime"),
	LastUpdatedTime: jsii.String("lastUpdatedTime"),
}
```

## Properties

- `callbackUrl`: string — Callback URL from the deployed provider, if known.

  **Default:** not set

- `clientSecretArn`: string — ARN of the Secrets Manager secret for OAuth2 client credentials, if known.

  **Default:** not set; required for {@link OAuth2CredentialProvider.bindForGatewayOAuthTarget } on imported providers

- `createdTime`: string — Resource creation time.

  **Default:** not set

- `credentialProviderArn`: string (required) — ARN of the credential provider.

- `credentialProviderVendor`: string (required) — Vendor string for this provider.

- `lastUpdatedTime`: string — Resource last-updated time.

  **Default:** not set
