Custom Refresh Logic
CredentialStore.RegisterRefresh("SuperCredential", (o) => {
//Call third party API
//Reach out to database
//Request keys from AWS
//Do anything you need to get authorization details
//Then return either a good credential:
return new CredentialStoreItem() {
Expiration = DateTimeOffset.Now.AddMinutes(60),
Authorization = "ABCDEFG",
Scope = "offline.access",
StoreA = "Custom ValueStore"
};
//Or a faulted one:
return new FaultedCredentialStoreItem("External ERROR", new Exception("Exception thrown while trying to get credential!!!"), retry: true);
});Last updated

