5

I got an high trusted provider hosted application that use the App Only Policy. If I try to use server object model, sharepoint returns a context error. Is it possible to use the client object model to read secure store credentials?

Thanks

2 Answers 2

3

This is something that is not possible, however you may create a custom web services instead as a work around.

This C# solution will be able to help you to build your web-services to get credentials,

Retrieving Credentials from the SharePoint Secure Store using C#

2
  • Hi Muhammad,thanks for the answer, but this is not the solution for me. Your example uses a SP webpart (that has a SPContext defined), instead, I need an example that help me to retrieve the credentials for a provider hosted apps with App Only Policy. In this envainment I don't have a valid SPContext. Commented Mar 6, 2014 at 14:22
  • @Domenico The example I have provided link for creates a proxy web services, and consumes it within a webpart, however what you need to do is to, create a web services similar to one in solution (in link), then call these web services in your highly trusted provider hosted application Commented Mar 6, 2014 at 14:27
0

I guess, you need the credentials so as to connect to an external system from under the provider-hosted add-in. In this case you may not need the credentials as such, but you can create an external content type and access a list based on this ECT in order to read the data from the external system. So the solution may be:

  1. Create an ECT for the external system you need the data from.
  2. Create a list based on this ECT.
  3. Read the list from your PHAI.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.