Domanda

I am trying to use Business Connectivity Services in SharePoint 2010 to interface with an Oracle database. I have created a .NET assembly connector in combination with some custom application pages to display the content, and it seems to work fine. I am using a Secure Store Target Application to store individual users' Oracle credentials, but I am not sure how to best allow individual users to actually supply those Oracle credentials when I discover in my code that they are not already present in the store. I see that the Target Application Settings page in Central Admin references a default Target Application Page URL. How can I programmatically get the URL for that default page? Is there a better way to allow users to supply their credentials when I find that they're not already in the store?

È stato utile?

Soluzione

I ran into the same problem you had if I understand you correctly. I solved it by using the CredentialManagementUrl property of the SecureStoreCredentialsNotFoundException that is thrown. The URL points to an input page where the user can enter their credentials. Like so:

try
{
    credentials = PipeChainCredentials.GetCredentials();
}
catch (SecureStoreCredentialsNotFoundException sscnfe )
{

    ErrorMessage = 
        "Your credentials could not be found. Please use <a href=\"{URL}\">this link</a> to enter them and try again."
        .Replace("{URL}", sscnfe.CredentialManagementUrl.ToString());
}

Where ErrorMessage is shown on the page.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top