Donnerstag, 10. Oktober 2013

Secure Store Service SharePoint 2010 GetCredentials Access denied

I had the problem, that I wanted to impersonate to SecureStoreService of SharePoint 2010 programmatically, but received an access denied at the point where the method GetCredentials is called.
This happen to me twice in different scenarios:
1. I tried to impersonate in an Elevated environment. Of course, then the used system account has to be also a member of the SecureStoreService.
2. I undid the impersonation after the code sequence and it seems having different methods calling other methods, impersonated and undid and the wrong place, when other methods tried to access.
That means, be aware which account is currently running the code and that this account is also a member of the SecureStoreService.
Try to keep the impersonation area as small as possible, to impersonation does not interfere with other impersonation-efforts.


1 Kommentar: