Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
    
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

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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