def METHOD_NAME():
    # as we don't use session from flask, then we save into user registry, at least for now
    if not app.auth.authorized([], 'global_preferences', 'POST'):
        return app.auth.authenticate()
    secrets = request.files.get('secretsFile', None)
    if secrets is None:
        return api_error('Please provide your youtube credentials', 400)
    secrets.seek(0)
    file_content = secrets.read()
    yt_data = json.loads(bytes2string(file_content))
    if 'web' not in yt_data:
        return api_error('OAuth project has to be configured as web in google console', 400)
    # let's save secrets file content in db for future usage
    global_serv = get_resource_service('global_preferences')
    global_serv.save_preference(YT_KEY, yt_data)
    redirect_uri = flask.url_for(
        'video_upload.oauth2callback', _external=True, _scheme=SCHEME)
    flow = Flow.from_client_config(
        yt_data, scopes=SCOPES, redirect_uri=redirect_uri)
    auth_url, _ = flow.authorization_url(
        prompt='consent',
        access_type='offline',
        include_granted_scopes='true')
    return make_response(auth_url, 200)