我有一个使用 Box sdk 的 Android 应用程序。Box 功能已经中断了一段时间,因为我终于开始更新到最新版本的 sdk。当我尝试使用我的应用程序对用户进行身份验证时,OAuthActivity
我被告知“错误:redirect_uri_missing”。
当我在 Box 开发人员页面上查看我的应用程序时,我看到它希望我在 OAuth2 参数部分输入重定向 uri。但是,尽管在寻找答案,但我对在这里输入什么感到非常困惑?
编辑:
基于下面的 API,我似乎可以使用下面的方法在没有设置重定向 uri 的情况下对 box 进行身份验证。但是,当我按如下方式使用它时,我得到:“错误: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)