You must Sign In to post a response.
  • Category: ASP.NET

    How to solve No OpenID endpoint found.(Exception thrown)

    my code is:
    protected void Page_Load(object sender, EventArgs e)
    {
    OpenIdRelyingParty rp = new OpenIdRelyingParty();
    var response = rp.GetResponse();
    if (response != null)
    {
    switch (response.Status)
    {
    case AuthenticationStatus.Authenticated:
    Session["GoogleIdentifier"] = response.ClaimedIdentifier.ToString();
    Response.Redirect("login.aspx");
    break;
    case AuthenticationStatus.Canceled:
    Session["GoogleIdentifier"] = "Cancelled.";
    break;
    case AuthenticationStatus.Failed:
    Session["GoogleIdentifier"] = "Login Failed.";
    break;
    }
    }
    }
    protected void btnGoogleLogin_Click(object sender, CommandEventArgs e)
    {
    string discoveryUri = e.CommandArgument.ToString();
    OpenIdRelyingParty openid = new OpenIdRelyingParty();
    var URIbuilder = new UriBuilder(Request.Url) { Query = "" };
    var req = openid.CreateRequest(discoveryUri, URIbuilder.Uri, URIbuilder.Uri);(here is the error)
    req.RedirectToProvider();
    }
    but iam getting an error like
    No OpenID endpoint found.(Exception thrown)
    Sequence contains no elements
  • #767923
    Hai Krishna,
    Loo ks like you are missing some config file settings . What is the proxy server setting you are using to connect? There must be some proxy server through which the request will be served and the response will get back. If the proxy server or the setting for the proxy server is missing, you will get this type of error.
    I am providing a link where you can check the setting and compare with your config file settings and then configure it in the same way:

    http://stackoverflow.com/questions/2520493/no-openid-endpoint-found

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #767924
    Yes as Pawan mentioned. Your configuration file might miss few things.

    1. Add Localhost in webcofig


    <add name="localhost" />


    2. Also check the Proxy setting in the configuration file.


    <defaultproxy>
    <proxy autoDetect="True"/>
    -----Remaining condition on related to Proxy connections

    </defaultproxy>


    Thanks,
    Mani

  • #767926
    This is my web.config
    <?xml version="1.0" encoding="utf-8"?>
    <!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=169433
    -->
    <configuration>
    <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </configSections>
    <connectionStrings>
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-google-20160921112631;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-google-20160921112631.mdf" />
    </connectionStrings>
    <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <pages>
    <namespaces>
    <add namespace="System.Web.Optimization" />
    </namespaces>
    <controls>
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
    </controls>
    </pages>
    <authentication mode="Forms">
    <forms loginUrl="~/Account/Login.aspx"
    timeout="2880" />
    </authentication>
    <profile defaultProvider="DefaultProfileProvider">
    <providers>
    <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
    </providers>
    </profile>
    <membership defaultProvider="DefaultMembershipProvider">
    <providers>
    <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
    </providers>
    </membership>
    <roleManager defaultProvider="DefaultRoleProvider">
    <providers>
    <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
    </providers>
    </roleManager>
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
    <providers>
    <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
    </providers>
    </sessionState>
    </system.web>
    <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
    <parameters>
    <parameter value="v11.0" />
    </parameters>
    </defaultConnectionFactory>
    </entityFramework>
    </configuration>


Sign In to post your comments