0
votes

We're facing a problem is that we want to install the same ASP.Net Core WebApp in multiple locations and route users using traffic managers but if we do that, we get issues because the authentication tokens get stored in one server and the user may access another one. I read that we can use Azure BlobStorage to share the keys, can someone please describe how?

We use openiddict for API login but I think that this doesn't affect the issue if we can use Azure BlobStorage for key storage.

Thank you

1
Is your token not attached with each request that goes to the server? Server should then try to validate that token, if its valid then it should read the required claims for user no matter which server gets the request via traffic manager. - Siddharth Pandey
@Sid The issue is that the token maybe attained from a different server (multiple webapps) - Techy
So you don't have a central Identity Server, correct? - Brad
@Brad Yes, we don't. I just want to know how to change key storage from current app to blobstorage - Techy

1 Answers

1
votes

As indicated in the documentation, you must reference the Microsoft.AspNetCore.DataProtection.AzureStorage package and use PersistKeysToAzureBlobStorage() to register the Azure Blob Storage key repository:

public void ConfigureServices(IServiceCollection services)
{
    services.AddDataProtection()
        .PersistKeysToAzureBlobStorage(new Uri("<blob URI including SAS token>"));
}