Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nguyen Dung Tri 104 posts 583 karma points
    Oct 04, 2016 @ 10:16
    Nguyen Dung Tri
    0

    How to create a connection string which points to Azure Active Directory in Web.Config?

    Hello Dan Lister,

    I have use your "Active Directory Providers" on my project. When I go to the line of "create connection string which points to Azure Active Directory", I don't know how to create a connection string myself.

    Here are the information I got from Azure Active Directory:

    ClientId: a92a056f-????-????-????-3a86545656e2
    
    Domain: somedomain.onmicrosoft.com
    
    My account to log into portal.azure.com:
    
    Username: trin@somedomain.com
    Pass: xxxxxxxxx
    

    What should I put in connectionUsername, connectionPassword, and connectionstring?

    Example:

    <connectionStrings>
        <add name="MyMembershipConnectionString" connectionString="LDAP://somedomain.onmicrosoft.com/OU=trin@somedomain.com,OU=somedomain,DC=somedomain,DC=onmicrosoft,DC=com" />
      </connectionStrings>
    

    <add name="MyMembersMembershipProvider" 
               type="RB.ActiveDirectoryProviders.ActiveDirectoryUmbracoMembersMembershipProvider, RB.ActiveDirectoryProviders" 
               connectionStringName="MyMembershipConnectionString" 
               connectionUsername="trin@somedomain.com" 
               connectionPassword="xxxxxxxx" 
               attributeMapUsername="sAMAccountName" 
               defaultMemberType="MemberType" />
    

    When I run my website, it generate an error: Parser Error Message: Unable to establish secure connection with the server

    So that my sample connection string is not correct. Do you have any suggestion?

    Regards, Dung Tri

  • cronywalls 2 posts 72 karma points
    1 week ago
    cronywalls
    0

    You can encrypt the connectionstring section of a web.config file by using aspnetregiis.exe command line tool, so it is never stored as plain text. This file is located in the %systemroot%\Microsoft.NET\Framework\versionNumber folder and you can use with -pef option. Consider you have an application named as MyWebApp. You can encrypt the connectionStrings section of the Web.config file by using aspnetregiis.exe as follows :

    aspnet_regiis.exe -pef "connectionStrings" "/MyWebApp"
    
Please Sign in or register to post replies

Write your reply to:

Draft