Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grabbing latest changes #1

Merged
merged 49 commits into from
Nov 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
50646ef
Updated XING Provider to v1.1.0
FabianBeiner Sep 13, 2015
4e51616
Merge pull request #542 from FabianBeiner/master
miled Sep 15, 2015
306475c
Create GitLab.php
ClassicCut Sep 16, 2015
1d520ab
Rename additional-providers/hybridauth-gitlab/GitLab.php to additiona…
ClassicCut Sep 16, 2015
db775ce
Update Auth.php
isantolin Sep 21, 2015
fa91998
Merge pull request #549 from isantolin/patch-1
StorytellerCZ Oct 1, 2015
2cac04b
Small fix (, instead of .).
FabianBeiner Oct 4, 2015
d8ed0b6
Fix warnings for getUserByResponse().
Oct 5, 2015
0115b0f
Require OAuth.php only if not exist
kgaut Oct 5, 2015
9b5dd3e
DateTime error
dmitriyzhuk Oct 8, 2015
ec5a47d
Merge pull request #558 from FabianBeiner/master
StorytellerCZ Oct 12, 2015
f2623a9
Merge pull request #559 from ShlyapkinG/master
StorytellerCZ Oct 12, 2015
750f619
Merge pull request #564 from Dreamvention/patch-1
StorytellerCZ Oct 12, 2015
fa9b248
Merge pull request #560 from kgaut/master
StorytellerCZ Oct 12, 2015
c69b6f0
2.5.1 release
Oct 12, 2015
e711d12
Merge branch 'master' of github.com:hybridauth/hybridauth
Oct 12, 2015
d2f0d63
2.5.1 release
Oct 12, 2015
cf2ad42
Get better size of user avatar
Oct 17, 2015
51e0a0f
[odnoklassniki] Improve error reporting
FractalizeR Oct 26, 2015
a9a7b2a
[Hybrid_Endpoint] Improve error reporting
FractalizeR Oct 26, 2015
faa475a
Merge pull request #571 from FractalizeR-Forks/he_error_handling
StorytellerCZ Oct 27, 2015
8d8471e
Merge pull request #570 from FractalizeR-Forks/odnoklassniki_error_fix
StorytellerCZ Oct 27, 2015
9985808
Merge pull request #567 from enjoyiacm/master
StorytellerCZ Oct 27, 2015
05388be
Merge pull request #547 from ClassicCut/master
StorytellerCZ Oct 27, 2015
dede9bb
2.6.0-dev
Oct 27, 2015
12a9bf5
Add cURL timeouts for OpenID
Oct 27, 2015
a653edd
Refactoring
Oct 28, 2015
6f24a4a
Refactoring and add $fields variable
Oct 28, 2015
9cbb6ae
Updating LightOpenID to 1.2.0
Oct 28, 2015
5f13ea3
Fix profileUrl
fortis Oct 29, 2015
304a7d9
Remove old line of code
fortis Oct 29, 2015
bb40155
Merge branch 'hybridauth/master'
Oct 29, 2015
0104a4e
MixCloud provider added
terehru Oct 31, 2015
ad4a20a
MixCloud provider added
terehru Oct 31, 2015
5854087
Merge pull request #575 from fortis/steam-provider
StorytellerCZ Nov 2, 2015
e159cb6
Merge pull request #577 from terehru/master
StorytellerCZ Nov 2, 2015
bce1e8a
Merge pull request #572 from truecaller/master
StorytellerCZ Nov 2, 2015
77b9964
Updating changelog
Nov 2, 2015
2dffe0e
Merge remote-tracking branch 'refs/remotes/hybridauth/master'
Nov 3, 2015
36728f6
Close #578
Nov 8, 2015
a260340
Update Odnoklassniki.php
Nov 10, 2015
f2282c9
Update Odnoklassniki.php
Nov 10, 2015
a69689b
Merge branch 'master' of https://github.com/enjoyiacm/hybridauth into…
Nov 10, 2015
c0f213d
git push origin masterMerge branch 'enjoyiacm-master'
Nov 10, 2015
42e6b5e
Merge pull request #580 from hybridauth/enjoyiacm-master
StorytellerCZ Nov 10, 2015
3d50f52
Facebook login read_stream deprecated for 2.5
neo22s Nov 13, 2015
9512431
Merge pull request #582 from neo22s/patch-1
StorytellerCZ Nov 19, 2015
1d69bff
Merge branch 'master' of github.com:hybridauth/hybridauth
Nov 19, 2015
b2cfa7f
Merge branch 'master' of github.com:hybridauth/hybridauth
Nov 19, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
Hybridauth Change log
=====================
2.6.0 - [not released]
New providers:
#546 + #547 - GitLab OAuth2
#577 - MixCloud
Updates:
Updated LightOpenID to 1.2.0
#572 - Add cURL timeouts for OpenID
#582 - [Facebook] read_stream removed
Changes:
#567 - [Odnoklassniki] Get better size of user avatar
#570 - [odnoklassniki] Improve error reporting
#571 - [Hybrid_Endpoint] Improve error reporting
Fixes:
#575 - [Steam] Fix Steam profileUrl
#578 - [Odnoklassniki] new link

2.5.1 - October 12 2015
Fixes:
#542 - [XING] updated provider to 1.1.0
#549 - Update Auth.php library version
#558 - [XING] Fix typo
#559 - [VKontakte] Fix warnings for getUserByResponse() for undefined City and Country
#560 - [Drupal module] Require OAuth.php only if not exist
#564 - Fix DateTime error in Logger

2.5.0 - September 7 2015
New:
#444 + #445 - Slack provider
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HybridAuth 2.5.0
# HybridAuth 2.6.0-dev

[![Join the chat at https://gitter.im/hybridauth/hybridauth](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hybridauth/hybridauth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Expand All @@ -16,8 +16,7 @@ HybridAuth repository is made up of several projects:

- **HybridAuth Core library** includes OpenID, Facebook, Twitter, LinkedIn, Google, Yahoo, Windows Live, Foursquare and AOL.
- **The additional providers project** contains many others services
which you may want to use,
- **Examples and demos** contains five examples for you to test,
which you may want to use.

## Getting Started

Expand Down
51 changes: 51 additions & 0 deletions additional-providers/hybridauth-gitlab/Providers/GitLab.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

/**
* Hybrid_Providers_GitLab - GitLab.com provider adapter based on the OAuth2 protocol.
*/
class Hybrid_Providers_GitLab extends Hybrid_Provider_Model_OAuth2
{
// default permissions
// (no scope) => public read-only access (includes public user profile info, public repo info, and gists).
public $scope = "api";

/**
* IDp wrappers initializer
*/
function initialize()
{
parent::initialize();

// Provider api end-points
$this->api->api_base_url = "https://gitlab.com/";
$this->api->authorize_url = "https://gitlab.com/oauth/authorize";
$this->api->token_url = "https://gitlab.com/oauth/token";
}

/**
* load the user profile from the IDp api client
*/
function getUserProfile()
{
$data = $this->api->api( "api/v3/user" );

if ( ! isset( $data->id ) ){
throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
}

$this->user->profile->identifier = @ $data->id;
$this->user->profile->displayName = @ $data->name;
$this->user->profile->description = @ $data->bio;
$this->user->profile->photoURL = @ $data->avatar_url;
$this->user->profile->profileURL = @ $data->html_url;
$this->user->profile->email = @ $data->email;
$this->user->profile->webSiteURL = @ $data->website_ur;
$this->user->profile->region = @ $data->location;

if( empty($this->user->profile->displayName) ){
$this->user->profile->displayName = @ $data->username;
}

return $this->user->profile;
}
}
80 changes: 80 additions & 0 deletions additional-providers/hybridauth-mixcloud/Providers/MixCloud.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php

/**
* Hybrid_Providers_MixCloud - MixCloud provider adapter based on OAuth2 protocol
*/
class Hybrid_Providers_MixCloud extends Hybrid_Provider_Model_OAuth2
{
// default permissions
public $scope = "";

public static $_profileData = null;


/**
* Initializer
*/
function initialize()
{
parent::initialize();

$this->api->api_base_url = 'https://api.mixcloud.com';
$this->api->authorize_url = 'https://www.mixcloud.com/oauth/authorize';
$this->api->token_url = 'https://www.mixcloud.com/oauth/access_token';

$this->api->curl_authenticate_method = "POST";
}

/**
* Begin login step
*/
function loginBegin()
{
// redirect the user to the provider authentication url
Hybrid_Auth::redirect($this->api->authorizeUrl());
}

/**
* @param $url endpoint relative URL
* @param null $params any request params
* @param bool|false $metadata Get metadata from API
* @return mixed
*/
function request($url, $params = null, $metadata = false)
{
$ch = curl_init();

$url = $url . '?access_token=' . $this->api->access_token;

if ($metadata)
{
$params['metadata'] = 1;
}

if ($params)
{
$url = $url . ( strpos( $url, '?' ) ? '&' : '?' ) . http_build_query($params, '', '&');
}
$url = $this->api->api_base_url . '/' . $url;

curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);

$data = json_decode($data, true);
return $data;
}

/**
* Returns user`s data
* @param bool|false $metadata
* @return mixed
*/
function getUser($metadata = false)
{
$result = $this->request('me/', null, $metadata);
return $result;
}
}
Loading