15 votes

Coop Oauth (Facebook, Google)

Add a login With Facebook or Google button to your site. Open Source, easily expandable to support more oauth providers.

INSTALLATION

 

1. Install Package

 

2. Replace YOURAPPID / YOURCLIENTID with your App Id / Client ID in CoopOauthFacebook / CoopOauthGooglePlus partial view.

 

3. Create an "OauthMember" Member Type with exactly that name and the following seven properties exactly (Sorry, umbraco did not let me package member types):

Name (Alias), Type

Provider (provider), Type: Textstring

Oauth Id (oauthId), Type: Textstring

Access Token (accessToken), Type: Textstring

First Name (firstName), Type: Textstring

Last Name (lastName), Type: Textstring

Picture (picture), Type: Textstring

 

4. Add the following keys to your Web.config appSettings:

<add key="CoopOauth_FacebookAppId" value="YOURAPPID" />

<add key="CoopOauth_FacebookAppSecret" value="YOURAPPSECRET" />

<add key="ClientValidationEnabled" value="true" />

<add key="UnobtrusiveJavaScriptEnabled" value="true" />

 

Example Member Information In View

var m = CoopRelay.Relay.Member.Current;

<h4>Welcome</h4> <span>@Html.ActionLink("Log out", "Logout", "OauthSurface")</span>

<img class="profile" src= "@m.Properties.GetString("picture")" alt="@m.Name" /> @Html.Raw(m.Name)



 

Screenshots

Package owner

Cock

Cock

Cock has 97 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
8.1.x (untested)
8.0.x (untested)
7.14.x (untested)
7.13.x (untested)
7.12.x (untested)
7.11.x (untested)
7.10.x (untested)
7.9.x (untested)
7.8.x (untested)
7.7.x (untested)
7.6.x (untested)
7.5.x (untested)
7.4.x (untested)
7.3.x (100%)
7.2.x (100%)
7.1.x (100%)
7.0.x (100%)
6.1.x (100%)
6.0.x (100%)

You must login before you can report on package compatibility.

Package Information

  • Package owner: Cock
  • Created: 10/04/2015
  • Current version 7.2
  • License MIT
  • Downloads: 1600