I created a WCF service that retrieves credentials from the secure store service in SharePoint. I created a target application in the secure store and set the Target Application Type to group. In the members people picker I put my domain account. When I ran the service, it failed. I changed the members to "domain\domain users" and it worked. I changed it again to a security group I am in and it failed again. I am not sure why the target application members has to be all domain users for the service to succeed.

Granted, I am using the secure store in kind of a backwards way. I am not using it to connect to an external source from SharePoint. I am using it as a repository for credentials that I plan on using, for example, in a provider-hosted app. In the app I will call the service, get the credentials, and use them where I need them.

So I am not sure why I need to have the application members set to all the domain users group for the service to work. Any help is appreciated.

I used the following site as a basis for the service:

Retrieving Credentials from the SharePoint Secure Store using C#

Edit: I think I may have discovered my issue. I was running the service's code using elevated permissions:

SPSecurity.RunWithElevatedPrivileges(delegate (){
     // code

I took that out it and it seems to work now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.