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?

  • I remember reading somewhere that you need to create a custom webpart that can collect credentials and store them in SecureStore. – shufler Dec 1 '11 at 19:10

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:

    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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.