def setUpClass(cls):
        print('~~~~TestMultiFactor::setUpClass~~~~')

        LR.API_KEY = env.API_KEY
        LR.API_SECRET = env.API_SECRET
        LR.LIBRARY = 'requests'
        cls.loginradius = LR()
        cls.set = setUp(cls.loginradius)
        cls.tear = tearDown(cls.loginradius)
    def setUpClass(cls):
        print('~~~~TestPhoneAuthentication::setUpClass~~~~')

        LR.API_KEY = env.API_KEY
        LR.API_SECRET = env.API_SECRET
        LR.LIBRARY = 'requests'
        cls.loginradius = LR()
        cls.set = setUp(cls.loginradius)
        cls.tear = tearDown(cls.loginradius)
        cls.phoneid = env.PHONE_NUM
Esempio n. 3
0
    def setUpClass(cls):
        print('~~~~TestRoles::setUpClass~~~~')

        LR.API_KEY = env.API_KEY
        LR.API_SECRET = env.API_SECRET
        LR.LIBRARY = 'requests'
        cls.loginradius = LR()
        cls.set = setUp(cls.loginradius)
        cls.tear = tearDown(cls.loginradius)
        cls.role_name = 'lr-pysdk-role'
Esempio n. 4
0
# - www.LoginRadius.com                         #
#################################################
# This file is part of the LoginRadius SDK      #
# package.                                      #
#################################################

#Your API Secret
API_SECRET = "YOUR_API_SECRET"
API_KEY = "YOUR_API_KEY"

#Essential package for LoginRadius to communicate
from LoginRadius import LoginRadius as LR
LR.API_KEY = API_KEY
LR.API_SECRET = API_SECRET
#LR.LIBRARY ='urllib2'
login = LR()
#We need a request
import cgi
#Get the 'token' from the POST request
arguments = cgi.FieldStorage()
token = arguments.getvalue('token')
#login = LoginRadius(token)
print("Content-Type: text/html\n\n")
print """
<link href="style.css" rel="stylesheet" type="text/css" media="all" />
"""
profile = login.sociallogin.profile(token)
#It is good practice to check if the token is valid
if login.accesstoken.validate(token):
    print '<div class="lr-profile-frame lr-input-style">'
    print '<div class="lr-profile-header">'
Esempio n. 5
0
from LoginRadius import LoginRadius as LR

# *** FILL IN CREDENTIALS ***
API_KEY = "<Enter LoginRadius API Key>"
API_SECRET = "<Enter LoginRadius API secret"
# ***************************

LR.API_KEY = API_KEY
LR.API_SECRET = API_SECRET
LR.LIBRARY = "requests"
LR.API_REQUEST_SIGNING = False
loginradius = LR()
Esempio n. 6
0
from flask import render_template, url_for, flash, redirect, request
from votingapp import app, db, bcrypt
from votingapp.forms import RegistrationForm, LoginForm
from votingapp.models import User, Votes
from flask_login import login_user, current_user, logout_user, login_required
from LoginRadius import LoginRadius as LR
import cgi

LR.API_KEY = "e91795bb-fa16-40b6-b9bd-1d8f120333de"
LR.API_SECRET = "e19e43cc-7ebe-42a1-999d-f3a271d12bd8"

LR.API_REQUEST_SIGNING = True

login_radius = LR()

# @app.before_first_request
# def setup():
#     # Drop tables if exists
#     db.drop_all()

#     # Creating tables
#     db.create_all()

#     #Inserting rows in candidatevotes table
#     db.session.add(Votes(candidate_name='Candidate A'))
#     db.session.add(Votes(candidate_name='Candidate B'))
#     db.session.add(Votes(candidate_name='Candidate C'))
#     db.session.add(Votes(candidate_name='Candidate D'))

#     # Commit
#     db.session.commit()