2

다른 사람들이 가능한 모든 해결책을 확인하고 앱 또는 코드 설정에 적용했지만 나에게 효과가있는 것은 없습니다. https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile Google 인증 Redirect_uri_missmatch 오류

  • CLIENT_ID : xxxxxxxx.apps.googleusercontent.com
  • 를 redirect_uri : http://localhost:8228/Auth/ExternalLoginCallback?__provider__=Google&__sid__=xxxxxxxxxxxxxxxxxxxx
  • 상태 : xxxxxxxxxxxxxxxxxxxx
  • RESPONSE_TYPE : code
  • 여기

    내가 base을 https://accounts.google.com/o/oauth2/auth

    • 범위를 통과했던 파라미터
    • access_type : online

    내가 무엇이 누락 되었습니까? 아무도 나에게 뭔가 제안 해주세요.

    하면 나는 오류 때마다 다음있어 :

    enter image description here

    이 내 앱 정보입니다 : enter image description here

    업데이트 1 : 여기

    RequestAuthentication 방법 클래스에 대한 내 코드입니다 google :

    public GoogleScopedClient(string cleintId, string clientSecretId) 
         { 
          this.cleintId = cleintId; 
          this.clientSecretId = clientSecretId; 
         } 
    
         public string ProviderName 
         { 
          get { return "Google"; } 
         } 
    
         public void RequestAuthentication(System.Web.HttpContextBase context, Uri returnUrl) 
         { 
          string state = Regex.Match(returnUrl.AbsoluteUri, "(?<=__sid__=).*?($|&)", RegexOptions.IgnoreCase).Value; 
    
          string url = baseUrl + HttpUtility.UrlEncode(SCOPE.ToString()) + 
           "&client_id=" + cleintId + "&redirect_uri=" +HttpUtility.UrlEncode(returnUrl.ToString()) 
    +"&response_type=code&access_type=online"; 
        context.Response.Redirect(url); 
         } 
    
    +0

    요청 세부 정보에서 무엇을 얻습니까? 이것을 보면, 뭔가를 놓친 것 같아요. – geminiousgoel

    +0

    우리가하는 일을 볼 수 있도록 코드를 제출해 주시겠습니까? – DaImTo

    +0

    @DaImTo는 'Update 1'을 살펴보십시오. 내 코드에서'RequestAuthentication'을 추가했습니다. –

    답변

    0

    리디렉션 URI가 일치하지 않습니다. 특히 Google 개발자 콘솔에서 지정한 내용은 http://localhost:8228/Auth/ExternalLoginCallback/이지만, 전송되는 내용은 http://localhost:8228/Auth/ExternalLoginCallback입니다 (뒤에 슬래시는 표시되지 않음). 그것들은 실제로 두 곳의 완전히 다른 URL입니다.

    +0

    제안 해 주셔서 감사합니다. 이 시도. –

    +0

    Google 개발자 콘솔에서 '/'을 (를) 제거했지만 동일한 오류가 표시됩니다. –