Skip to content

Commit

Permalink
Messing around.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffputz committed Jul 14, 2019
1 parent 8c35034 commit 9b87ec9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 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
Expand Down
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/PopIdentity.Sample/Controllers/HomeController.cs
Expand Up @@ -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";
Expand Down
9 changes: 8 additions & 1 deletion src/PopIdentity.sln
Expand Up @@ -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
Expand Down
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 9b87ec9

Please sign in to comment.