Last active
August 30, 2016 08:37
-
-
Save medokin/9069e2fc48c7e290f71f0ca2308d63be to your computer and use it in GitHub Desktop.
Oauth Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddles', | |
actions: { | |
authenticateOAuth(){ | |
this.get('torii').open('gitlab-oauth2').then(function(authorization){ | |
// FB.api is now available. authorization contains the UID and | |
// accessToken. | |
controller.set('hasFacebook', true); | |
}); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Provider from 'torii/providers/oauth2-bearer'; | |
import {configurable} from 'torii/configuration'; | |
/** | |
* This class implements authentication against Azure | |
* using the OAuth2 authorization flow in a popup window. | |
* @class | |
*/ | |
var GitlabOauth2 = Provider.extend({ | |
name: 'gitlab-oauth2', | |
baseUrl: 'https://gitlab.com/oauth/authorize', | |
// additional url params that this provider requires | |
requiredUrlParams: ['client_id'], | |
responseParams: ['code'], | |
clientId: '4c605021ea85362d64ef8511b8b509d41df49ea98b59421a69f922fe44dd2e92', | |
redirectUri: 'https://ember-twiddle.com/9069e2fc48c7e290f71f0ca2308d63be', | |
}); | |
export default GitlabOauth2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.10.4", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.6.0", | |
"ember-data": "2.6.0", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": { | |
"torii": "0.8.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment