コード例 #1
0
 def testConfingParserGoogleOAuth(self):
     self.assertEqual(
         GOOGLE_CLIENT_ID_KEY,
         config_reader.getGoogleClientID())
     self.assertEqual(
         GOOGLE_CLIENT_SECRET_KEY,
         config_reader.getGoogleClientSecret())
コード例 #2
0
AUTHORIZED_URL = '/login/google/authorized'
oauth = OAuth()
google_oauth = Blueprint('google_oauth', __name__)
google = oauth.remote_app(
    'google',
    base_url='https://www.google.com/accounts/',
    authorize_url='https://accounts.google.com/o/oauth2/auth',
    request_token_url=None,
    request_token_params={
        'scope': 'https://www.googleapis.com/auth/userinfo.email',
        'response_type': 'code'},
    access_token_url='https://accounts.google.com/o/oauth2/token',
    access_token_method='POST',
    access_token_params={
        'grant_type': 'authorization_code'},
    consumer_key=getGoogleClientID(),
    consumer_secret=getGoogleClientSecret())


class LoginGoogleResource(Resource):

    def get(self):
        print "getGoogleRedirectUrl() {0}".format(getGoogleRedirectUrl())
        return google.authorize(callback=getGoogleRedirectUrl())


def processGoogleData(data):
    EMAIL = 'email'
    _ID = 'id'
    FIRST_NAME = 'given_name'
    LAST_NAME = 'family_name'
コード例 #3
0
 def testConfingParserGoogleOAuth(self):
     self.assertEqual(GOOGLE_CLIENT_ID_KEY,
                      config_reader.getGoogleClientID())
     self.assertEqual(GOOGLE_CLIENT_SECRET_KEY,
                      config_reader.getGoogleClientSecret())