Reputation: 82
As in the below picture the Purposes string of IDataProtectionProvider is taking default values of my project physical root path. My problem is when i encrypt data from my local host and the same cannot be accessed from another machine as the key of IDataProtectionProvider is my local host path.
How to disable the auto generated purpose key in IDataProtectionProvider. I found one here. But when i try to decrypt the data. it saying no key found. Please help me guys.
Upvotes: 5
Views: 1171
Reputation: 196
I had the same issue as OP. In my case it was because of the default ApplicationDescriminator.
services
.AddDataProtection(o => {
o.ApplicationDiscriminator = "WhatYouWant";
}
);
When I change it, the default path will be overridden.
Setting it to ""
will remove it entirely.
But it seems like a good feature to have so I would keep it.
Hope this can help people in the future.
Upvotes: 7