def METHOD_NAME(*args, **kwargs):
	r = frappe.request
	try:
		(scopes, frappe.flags.oauth_credentials,) = get_oauth_server().validate_authorization_request(
			r.url, r.method, r.get_data(), r.headers
		)
		headers, body, status = get_oauth_server().create_authorization_response(
			uri=frappe.flags.oauth_credentials["redirect_uri"],
			body=r.get_data(),
			headers=r.headers,
			scopes=scopes,
			credentials=frappe.flags.oauth_credentials,
		)
		uri = headers.get("Location", None)
		frappe.local.response["type"] = "redirect"
		frappe.local.response["location"] = uri
		return
	except (FatalClientError, OAuth2Error) as e:
		return generate_json_error_response(e)