odd2b1.open.sociallogin
1.0.1
dotnet add package odd2b1.open.sociallogin --version 1.0.1
NuGet\Install-Package odd2b1.open.sociallogin -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="odd2b1.open.sociallogin" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add odd2b1.open.sociallogin --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: odd2b1.open.sociallogin, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install odd2b1.open.sociallogin as a Cake Addin #addin nuget:?package=odd2b1.open.sociallogin&version=1.0.1 // Install odd2b1.open.sociallogin as a Cake Tool #tool nuget:?package=odd2b1.open.sociallogin&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sociallogin
Use sociallogin to integrate facebook,Google Login to your web forms projects.
Config File
Add the following Keys in web config file.
<appSettings>
//For Facebook
<add key="fbsecret" value="Facebook Secret Key" />
<add key="fbscope" value="public_profile,email" />
<add key="fbredirecturi" value="Your Redirect URL" />
<add key="fbappid" value="Facebook Client ID/App Id" />
//For Google
<add key="googlesecret" value="Google Secret Key" />
<add key="googleredirecturi" value="Google Redirect URL" />
<add key="googleclientid" value="Google Client Id" />
</appSettings>
Add a Login Button.
<asp:LinkButton ID="fbbtn" runat="server" Text="FB Login" onClick="Clickfb">
</asp:LinkButton>
<asp:LinkButton ID="googlebtn" runat="server" Text="Google Login" onClick="Clickgoogle">
</asp:LinkButton>
Redirect Page to Login
//for Facebook
Response.Redirect(facebookauth.loginpopup());
//For Google
Response.Redirect(googleauth.loginpopup());
Redirect Page
On Redirect Page
//For Facebook
protected void Page_Load(object sender, EventArgs e)
{
if(Request.QueryString["code"] != null)
{
var result = facebookauth.verifyauth(Request.QueryString["code"]);
if(result.issucces)
{
// result.id,
// result.email,
//result.name,
//result.first_name,
//result.last_name,
//result.gender,
//result.birthday
}
else
{
// result.error.message;
// result.error.code;
// result.error.fbtrace_id;
}
}
}
//For Google
protected void Page_Load(object sender, EventArgs e)
{
if(Request.QueryString["code"] != null)
{
var result = googleauth.verifyauth(Request.QueryString["code"].ToString());
if(result.issuccess)
{
//result.id;
//result.email;
//result.name;
//result.given_name;
//result.family_name;
//result.picture;
}
else
{
//result.error.error;
//result.error.error_description;
}
}
}
Demo
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.