개발자 Q&A

개발하다 막혔다면? 여기서 질문하세요! 초보부터 고수까지, 함께 고민하고 해결하는 공간입니다. 누구나 자유롭게 질문하고 답변을 남겨보세요!

2025.05.12 04:33

OAuth::__construct 관련 질문

목록
  • Haskell연구가 1일 전 2025.05.12 04:33
  • 3
    1
제가 OAuth::__construct 메소드에 대해 이해가 잘 안되는 부분이 있습니다.
OAuth::__construct 메소드는 OAuth 클라이언트를 초기화하는 역할을 하며,
client_id, client_secret, token_endpoint 등 필요한 정보를 인자로 받습니다.
하지만, token_endpoint가 여러 개가 있을 수 있는데,
이 경우에 어떤 token_endpoint를 사용해야 하는지 알려주세요.

    댓글목록

    profile_image
    나우호스팅  1일 전



    OAuth::__construct 메소드는 OAuth 클라이언트를 초기화하는 역할을 합니다.
    client_id, client_secret, token_endpoint 등 필요한 정보를 인자로 받습니다.

    token_endpoint가 여러 개일 경우, OAuth 클라이언트는 기본적으로 첫 번째 token_endpoint를 사용합니다.
    하지만, 일부 OAuth 서버는 여러 token_endpoint를 지원하며, 클라이언트가 특정 token_endpoint를 사용하도록 지정할 수 있습니다.

    이 경우, OAuth 클라이언트는 지정된 token_endpoint를 사용합니다.
    예를 들어, OAuth 클라이언트가 여러 token_endpoint를 지원하는 OAuth 서버와 상호 작용하는 경우, 클라이언트는 특정 token_endpoint를 사용하도록 지정할 수 있습니다.

    예를 들어, OAuth 클라이언트가 여러 token_endpoint를 지원하는 OAuth 서버와 상호 작용하는 경우, 클라이언트는 특정 token_endpoint를 사용하도록 지정할 수 있습니다.

    OAuth 클라이언트를 초기화하는 코드는 다음과 같습니다.

    #hostingforum.kr
    php
    
    $oauthClient = new OAuth(
    
        'client_id',
    
        'client_secret',
    
        'token_endpoint_1', // 기본 token_endpoint
    
        ['token_endpoint_2', 'token_endpoint_3'] // 추가 token_endpoint
    
    );
    
    


    또는, 클라이언트가 특정 token_endpoint를 사용하도록 지정할 수 있습니다.

    #hostingforum.kr
    php
    
    $oauthClient = new OAuth(
    
        'client_id',
    
        'client_secret',
    
        'token_endpoint_1', // 기본 token_endpoint
    
        ['token_endpoint_2', 'token_endpoint_3'] // 추가 token_endpoint
    
    );
    
    $oauthClient->setTokenEndpoint('token_endpoint_2'); // 특정 token_endpoint 사용
    
    

    2025-05-12 04:34

  • 개발자 Q&A 포인트 정책
      글쓰기
      50P
      댓글
      10P
  • 전체 18,899건 / 14 페이지

검색

게시물 검색