2014-11-18 1 views
1

Box sdk를 사용하는 Android 애플리케이션이 있습니다. 마지막으로 sdk의 최신 버전으로 업데이트하려고하는 동안 Box 기능이 잠시 중단되었습니다. OAuthActivity을 사용하여 응용 프로그램에서 사용자를 인증하려고하면 "error : redirect_uri_missing"이라는 메시지가 나타납니다.Android 애플리케이션에 OAuth2.0 및 Box와 함께 리디렉션 URI를 사용하는 방법은 무엇입니까?

상자 개발자 페이지에서 내 애플리케이션을 볼 때 OAuth2 매개 변수 섹션에 리디렉션 URI를 입력해야합니다. 그러나 답변을 검색 함에도 불구하고 여기에 무엇을 입력해야하는지에 관해 철저히 혼란 스럽습니다.

편집 : 아래의 API를 기반으로

, 그것이 내가 리디렉션 URI 설정하지 않고 상자에 인증하기 위해 아래의 방법을 사용할 수있는 것으로 보인다. 그러나 다음과 같이 사용하면 "Errror : insecure_redirect_uri"가 표시됩니다.

OAuthActivity.createOAuthActivityIntent(activity, KEY, SECRET, false, "http://localhost"); 

/** 
    * Create intent to launch OAuthActivity. Notes about redirect url parameter: If you already set redirect url in <a 
    * href="https://cloud.app.box.com/developers/services">box dev console</a>, you should pass in the same redirect url or use null for redirect url. If you 
    * didn't set it in box dev console, you should pass in a url. In case you don't have a redirect server you can simply use "http://localhost". 
    * 
    * @param context 
    *   context 
    * @param clientId 
    *   your box client id 
    * @param clientSecret 
    *   your box client secret 
    * @param allowShowRedirectPage 
    *   Whether you want to load/show redirected page after OAuth flow is done. 
    * @param redirectUrl 
    *   redirect url, if you already set redirect url in <a href="https://cloud.app.box.com/developers/services">box dev console</a>, leave this null 
    *   or use the same url, otherwise this field is required. You can use "http://localhost" if you don't have a redirect server. 
    * @return 
    */ 
    public static Intent createOAuthActivityIntent(final Context context, final String clientId, final String clientSecret, 
     final boolean allowShowRedirectPage, String redirectUrl) 

답변

0

당신은 http://127.0.0.1 또는 https://127.0.0.1 (루프백 주소) 혼란에 대한

2

죄송는,이 문서의 일부가 유효 기간이 입력 할 수 있습니다. 응용 프로그램 구성 페이지 (here)에서 리디렉션 URI로 https://localhost을 사용해야합니다. 안전하지 않은 리디렉션 URI는 더 이상 허용되지 않으므로 HTTPS를 사용해야합니다. 리디렉션 URI가 앱용으로 설정되면 redirectUrl 매개 변수를 null로 남겨 둘 수 있습니다.

관련 문제