# Path: ob2/util/security.py
# def generate_shitty_random_string(N=30):
#     return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N))


import github3
import requests
import urllib
import urlparse
import ob2.config as config
from flask import session
from ob2.util.security import generate_shitty_random_string


github_oauth_url = "https://github.com/login/oauth"
access_token_url = github_oauth_url + "/access_token"
authorize_url = github_oauth_url + "/authorize"
user_url = "https://github.com"


class AuthenticationError(Exception):
    pass


class AuthenticationTemporaryError(AuthenticationError):
    pass


class AuthenticationIntegrityError(AuthenticationError):
    pass


def get_authentication_provider_url(redirect_uri):
    if config.github_oauth_consumer_key:

# Path: ob2/util/security.py
# def generate_shitty_random_string(N=30):
#     return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N))


# Path: ob2/util/github_login.py
import github3
import requests
import urllib
import urlparse
import ob2.config as config
from flask import session
from ob2.util.security import generate_shitty_random_string



github_oauth_url = "https://github.com/login/oauth"
access_token_url = github_oauth_url + "/access_token"
authorize_url = github_oauth_url + "/authorize"
user_url = "https://github.com"


class AuthenticationError(Exception):
    pass


class AuthenticationTemporaryError(AuthenticationError):
    pass


class AuthenticationIntegrityError(AuthenticationError):
    pass


def get_authentication_provider_url(redirect_uri):
    if config.github_oauth_consumer_key:

        state = generate_shitty_random_string()