내 .htaccess 파일에 다음을 포함하는 Apache 프록시 서버 설정이 있습니다.
#Header always set Access-Control-Allow-Origin "*"
Header onsuccess unset Access-Control-Allow-Origin
Header always set Access-Control-Allow-Origin *
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding, x-api-token"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]]
RewriteRule "^proxy/https/(.*)$" "https://$1" [P]
RewriteRule "^proxy/http/(.*)$" "http://$1" [P]
Python을 사용하여 다음 코드를 사용하여 연결했지만 503 오류가 발생했습니다. 어떤 조언이라도 감사하겠습니다
# Sample Basic Auth Url with login values as username and password
import requests
from base64 import b64encode
import json
import csv
import pythoncom
import win32com.adsi as adsi
import types
from pyad import aduser
import logging
import datetime
import os
import requests
url = "https://proxy.testserverenv.com/proxy/https/grouper.devenv.com/grouper-ws/servicesRest/v2_3_000/groups?wsLiteObjectType=WsRestFindGroupsLiteRequest&queryFilterType=FIND_BY_STEM_NAME&stemName=app:groupergroups"
user = "user"
passwd = "Pas$worD"
#debugging print statement 2/4
print("URL set")
# Make a request to the endpoint using the correct auth values
auth_values = (user, passwd)
response = requests.get(url, auth=auth_values)
다음을 사용하여 기본 인증을 헤더 인증으로 변환하려고 합니다.