2014-10-07 4 views
1

내 인증을 위해 Google 인증을 사용하고 있습니다. 이제 한 명의 사용자 만 브라우저에서 Google에 로그인하고 이전에 인증 된 경우 자동으로 로그인됩니다.ServiceStack Google Oauth 인증 URL 수정

이 게시물 Force google account chooser은 Google Oauth 인증 url에 강제 매개 변수 추가 (prompt = select_account)가 있음을 나타냅니다. 계정 선택 목록이 나타납니다.

어떤 질문이 있는데, ServiceStack을 사용할 때 인증 요청을 할 때이 URL을 편집하거나 추가 할 수있는 방법이 있습니까? 당신이 원하는 경우 공급자를 등록 할 때 코드에서

<appSettings> 
    <add key="oauth.GoogleOAuth.AuthorizeUrl" 
     value="https://accounts.google.com/o/oauth2/auth?prompt=consent"/> 
</appSettings> 

을 또는 :

답변

1

당신은 어떤으로 AuthProvider에 의해 하나 귀하의 Web.config에 사용 된 가져옵니다 AuthorizeUrl을 변경할 수 있습니다

Plugins.Add(new AuthFeature(
    () => new CustomUserSession(), 
    new IAuthProvider[] { 
     //... 
     new GoogleOAuth2Provider(appSettings) { 
      AuthorizeUrl = "https://accounts.google.com/o/oauth2/auth?prompt=consent" 
     } 
    })); 
+0

많은 감사합니다. 즉시 일했습니다. –