diff --git a/LICENSE b/LICENSE index effb9b1..9d5f83d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Jeff Putz +Copyright (c) 2019 Jeff Putz and POP World Media, LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6c1403b..41a6efd 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ POP Identity is a lightweight, low-opinion, mini-library for social and third-party logins in ASP.NET Core. +## Project status +This is super alpha. Hopeful roadmap is to support round-tripping to Google, Facebook, Twitter, maybe generic OAuth and Microsoft, resulting in user data that you can persist as you wish. + ## Who is this for? This is for people who think that the existing ASP.NET Core external login system is too much magic, or too tightly coupled to Identity and/or EntityFramework. It didn't evolve much from the old OWIN days. It has the following goals: * Be super light-weight, handing off just enough mundane detail to the library. diff --git a/src/PopIdentity.Sample/Controllers/HomeController.cs b/src/PopIdentity.Sample/Controllers/HomeController.cs index 36eb579..745e00e 100644 --- a/src/PopIdentity.Sample/Controllers/HomeController.cs +++ b/src/PopIdentity.Sample/Controllers/HomeController.cs @@ -31,7 +31,7 @@ public HomeController(IPopIdentityConfig popIdentityConfig, ILoginLinkFactory lo public IActionResult Index() { - ViewBag.GoogleLink = $"https://accounts.google.com/o/oauth2/v2/auth?client_id={_popIdentityConfig.GoogleClientID}&redirect_uri=https%3A%2F%2Flocalhost:44353%2Fhome%2Fcallback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&state=1234&response_type=code"; + ViewBag.GoogleLink = $"https://accounts.google.com/o/oauth2/v2/auth?client_id={_popIdentityConfig.GoogleClientID}&redirect_uri=https%3A%2F%2Flocalhost:44353%2Fhome%2Fcallback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid+email+profile&state=1234&response_type=code"; // This URL has to be specified in the Facebook developer console under "Valid OAuth Redirect URIs." var facebookRedirect = "https://localhost:44353/home/callbackfb"; diff --git a/src/PopIdentity.sln b/src/PopIdentity.sln index 3eb6516..ece4606 100644 --- a/src/PopIdentity.sln +++ b/src/PopIdentity.sln @@ -5,7 +5,14 @@ VisualStudioVersion = 16.0.28922.388 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PopIdentity.Sample", "PopIdentity.Sample\PopIdentity.Sample.csproj", "{1A0251C4-34EC-488D-9E3C-12517FE01FE3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PopIdentity", "PopIdentity\PopIdentity.csproj", "{C5634E47-586A-4120-86AC-FDBFC63F2186}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PopIdentity", "PopIdentity\PopIdentity.csproj", "{C5634E47-586A-4120-86AC-FDBFC63F2186}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C6E00B5C-A982-49C3-8CC3-40D3F49FB2A4}" + ProjectSection(SolutionItems) = preProject + ..\.gitignore = ..\.gitignore + ..\LICENSE = ..\LICENSE + ..\README.md = ..\README.md + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/PopIdentity/Providers/Facebook/FacebookLinkGenerator.cs b/src/PopIdentity/Providers/Facebook/FacebookLinkGenerator.cs index 2640b87..5035583 100644 --- a/src/PopIdentity/Providers/Facebook/FacebookLinkGenerator.cs +++ b/src/PopIdentity/Providers/Facebook/FacebookLinkGenerator.cs @@ -8,7 +8,7 @@ public string GetLink(string baseUrl, string clientID, string redirectUrl, strin { var urlEncodedRedirect = HttpUtility.UrlEncode(redirectUrl); var urlEncodedState = HttpUtility.UrlEncode(state); - var link = $"{baseUrl}?client_id={clientID}&redirect_uri={urlEncodedRedirect}&state={urlEncodedState}&response_type=code"; + var link = $"{baseUrl}?client_id={clientID}&redirect_uri={urlEncodedRedirect}&state={urlEncodedState}&response_type=code&scope=email"; return link; } }