# RestSharp Authenticator

To register a specific <mark style="color:blue;">**RestSharp**</mark> credential, just create that type and assign the appropriate Authenticator.

```csharp
CredentialStore.RegisterRefresh("ClientAPI", (o) => {

        return new RestSharpCredentialStoreItem(
                new RestSharp.Authenticators.JwtAuthenticator("MyToken"), 
                DateTimeOffset.UtcNow.AddMinutes(58));
        
});
```

Any time you create a client, simply assign this credential authenticator:

```csharp
var rco = new RestClientOptions("https://localhost.com")
{
    //Assign the CredentialAuthenticator with the name tied to the refresh
    Authenticator = new CredentialAuthenticator("ClientAPI")
};

//Create a new client
using var client = new RestClient(rco);

//Anytime you execute any requests, it's automatically maintained. 
```
