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
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions: 7.3.x, 7.2.x, 7.1.x, 7.0.x

Package Information

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