首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过圆方请求雅虎OAuth作用域时出现问题

通过圆方请求雅虎OAuth作用域时出现问题
EN

Stack Overflow用户
提问于 2021-03-10 21:51:32
回答 1查看 146关注 0票数 0

我目前正在使用Roundcube的1.5版本,并尝试将其配置为与Yahoo邮件服务器配合使用。我已经创建了一个应用程序,还允许从OpenID的电子邮件和配置文件应用程序接口权限。作用域有一个问题,当尝试登录时,它会重定向回一个错误页面,并说:“请从已注册的作用域请求作用域,然后再次提交”。这是Roundcube的当前配置:

代码语言:javascript
复制
    // Enable OAuth2 by defining a provider. Use 'generic' here
$config['oauth_provider'] = 'yahoo';

// Provider name to be displayed on the login button
$config['oauth_provider_name'] = 'Yahoo';

// Mandatory: OAuth client ID for your Roundcube installation
$config['oauth_client_id'] = '------';

// Mandatory: OAuth client secret
$config['oauth_client_secret'] = '------';

// Mandatory: URI for OAuth user authentication (redirect)
$config['oauth_auth_uri'] = 'https://api.login.yahoo.com/oauth2/request_auth';

// Mandatory: Endpoint for OAuth authentication requests (server-to-server)
$config['oauth_token_uri'] = 'https://api.login.yahoo.com/oauth2/get_token';
    
// Optional: Endpoint to query user identity if not provided in auth response
//$config['oauth_identity_uri'] = 'null';

// Optional: disable SSL certificate check on HTTP requests to OAuth server
// See http://docs.guzzlephp.org/en/stable/request-options.html#verify for possible values
$config['oauth_verify_peer'] = true;

// Mandatory: OAuth scopes to request (space-separated string)
$config['oauth_scope'] = 'openid mail-r mail-w sdct-w';

// Optional: additional query parameters to send with login request (hash array)
$config['oauth_auth_parameters'] = ['nonce' => mt_rand(), 'prompt' => 'consent'];

// Optional: array of field names used to resolve the username within the identity information
$config['oauth_identity_fields'] = null;

// Boolean: automatically redirect to OAuth login when opening Roundcube without a valid session
$config['oauth_login_redirect'] = true;

以下是应用程序的设置:https://imgur.com/pwtNsvx

错误:

https://imgur.com/i11vMnM

https://imgur.com/Ar0tvnK

https://imgur.com/5Lertax

https://imgur.com/aRLVOLt

https://imgur.com/7d2L4Xv

EN

回答 1

Stack Overflow用户

发布于 2021-03-13 01:54:27

您需要首先请求访问受限作用域。一旦获得批准,您需要创建一个应用程序并选择邮件范围(电子邮件范围是为了访问用户的“电子邮件”身份,而不是访问邮箱)。请参阅https://developer.verizonmedia.com/mail

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66566126

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档