0

api로 오는 요청을 인증하여 올바른 Google 계정을 만들고 싶습니다. Google과의 종점 API 인증

@endpoints.api(name='echo', 
      version='v1', 
      allowed_client_ids=[API_EXPLORER_CLIENT_ID, 
           "*****-************.apps.googleusercontent.com"], 
      auth_level=AUTH_LEVEL.REQUIRED) 
class EchoApi(remote.Service): 
    @endpoints.method(
        # This method takes a ResourceContainer defined above. 
        ECHO_RESOURCE, 
        # This method returns an Echo message. 
        EchoResponse, 
        path='echo', 
        http_method='POST', 
        name='echo', 
        api_key_required=True) 
    def echo(self, request): 
     print endpoints.get_current_user() 
     print request 
     output_content = ' '.join([request.content] * request.n) 
     return EchoResponse(content=output_content) 

은 위 내가 요청이 여전히 백엔드

답변

0

get_current_user()가 없음을 반환하지 않는 경우 당신은 확인해야 도달 인증 헤더가없는 요청을 보내 또한 만약 내가 다음 구현 된 코드입니다.

auth_level은이 버전의 Framework에서 실제로 어떤 작업도 수행하지 않습니다.

+0

감사합니다. 장래에 기대할 수 있습니까? –