简短问题: 在Magento中为管理区域实施Google Api OAuth2身份验证的最简洁方法是什么?
长篇问题: 所有新的Google API都使用OAuth2.php客户端库在这里,它抽象OAuth2处理 https://code.google.com/p/google-api-php-client/
这个过程很简单
客户端库中的示例都是平面文件.所以我正在寻找将其融入MVC结构的最佳方式......或者Magento是精确的.
让我们具体一点.它用于检索Google通讯录.到目前为止,我有:
我遇到的问题是我不能做最后的重定向.即使我使用adminhtml帮助器getUrl方法,它附加了'key'url参数,当我从前端重定向到后端时,我被踢到仪表板.
有没有更好的方法在Magento中实现Googles OAuth2?
如何重定向到直接管理URL?
我一直在尝试使用服务帐户访问Calendar v3 API.我已经从管理控制台添加了范围 https://www.googleapis.com/auth/calendar,并将该日历与该服务帐户的电子邮件地址共享.
我也使用相同的服务帐户访问https://www.googleapis.com/auth/coordinate范围,并且工作正常.
此外,尝试撤销访问权限如下所述:为什么Google Calendar API(oauth2)以"权限不足"进行响应?
所有这一切,我仍然得到;
{"error"=>
{"errors"=>
[{"domain"=>"global",
"reason"=>"insufficientPermissions",
"message"=>"Insufficient Permission"}],
"code"=>403,
"message"=>"Insufficient Permission"}}
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
ruby-on-rails google-calendar-api google-api http-status-code-403 google-api-client
我对Google Play Services 6.1.71没有任何问题(因为一切正常)但与新版本(6.5.87)不一样.
我已经知道LocationClient在6.5.87 Google Play Services课程中不推荐使用类,我在转换旧的GeofenceDetection示例时几乎没有问题.
OnAddGeofencesResultListener,OnRemoveGeofencesResultListener而且我曾经在控制台上处理错误;我修改过的代码是:
ReceiveTransitionsIntentService.java
public class ReceiveTransitionsIntentService extends IntentService {
/**
* Sets an identifier for this class' background thread
*/
public ReceiveTransitionsIntentService() {
super("ReceiveTransitionsIntentService");
}
/**
* Handles incoming intents
*
* @param intent The Intent sent by Location Services. This Intent is provided
* to Location Services (inside a PendingIntent) when you call addGeofences()
*/
@Override
protected void onHandleIntent(Intent intent) { …Run Code Online (Sandbox Code Playgroud) java android google-api-client geofencing google-play-services
我想获取重复事件的所有事件。
因此,我将选项singleEvents设置为true。现在,当我列出所有事件时,响应会返回无尽的项目(通过使用 nextPageToken)。当然,我可以设置 MaxTime 来设置最大时间限制。
但是,我需要syncToken 来仅获取更新的事件。否则我的服务器有很多同步任务。:(
当事情发生变化时,服务器会收到推送通知。当我创建重复事件时,服务器收到推送通知并尝试通过最后一个syncToken(使用list events )获取更新的事件。
如何设置最大时间限制,以便我可以获得 nextSyncToken 而无需无限的 nextPages。
我正在尝试使用播放服务8.3中引入的新Google登录API来获取用户的个人资料.除了显示名称,电子邮件和身份证,我还需要用户的性别.
Plus.PeopleApi.getCurrentPerson()
Run Code Online (Sandbox Code Playgroud)
根据播放服务8.3不推荐使用,即使我也为null返回null
mGoogleApiClient.hasConnectedApi(Plus.API)
Run Code Online (Sandbox Code Playgroud)
返回true.
GoogleSignInAccount.getGrantedScopes
Run Code Online (Sandbox Code Playgroud)
回报
https://www.googleapis.com/auth/plus.me
https://www.googleapis.com/auth/plus.login
profile
email
openid
Run Code Online (Sandbox Code Playgroud)
Google Developer Console未在Google+ API上显示任何匹配.我已将正确的google-services.json文件放在应用程序的app /文件夹中.我甚至以编程方式生成SHA1指纹以验证我是否使用了正确的密钥库.
如何使用新登录API获取此人的Google +个人资料数据(性别,姓氏,姓名等)?
android google-api-client google-play-services google-plus-signin google-signin
我使用从最近发布的谷歌的人API的例子在这里.我稍微扩展了一些示例,以显示有关联系人的其他信息,例如电子邮件地址和电话号码.应该完成这项工作的代码如下所示.
public class PeopleQuickstart {
...
public static void getPersonInfo(Person person){
// Get names
List<Name> names = person.getNames();
if(names != null && names.size() > 0) {
for(Name personName: names) {
System.out.println("Name: " + personName.getDisplayName());
}
}
// Get email addresses
List<EmailAddress> emails = person.getEmailAddresses();
if(emails != null && emails.size() > 0) {
for(EmailAddress personEmail: emails) {
System.out.println("Email: " + personEmail.getValue());
}
}
// Get phone numbers
List<PhoneNumber> phones = person.getPhoneNumbers();
if(phones != null && phones.size() > 0) { …Run Code Online (Sandbox Code Playgroud) 我正在创建一个 Google Doc to HTML 转换器,我想使用Doc Api而不是使用 Drive Api 将其导出为 HTML:
$service = new Google_Service_Docs($client);
$request = $service->documents->get($docId);
$elements = $request->getBody()->getContent();
Run Code Online (Sandbox Code Playgroud)
$elements 是 Google_Service_Docs_StructuralElement 的数组
循环遍历段落 > 元素,如果有内联对象,则使用 Google_Service_Docs_InlineObjectElement 设置 inlineObjectElement 属性
问题是:如何获取 Google_Service_Docs_InlineObjectElement 的内容以将其保存为文件?我们在这个对象中只有一个 inlineObjectId ......
google-api google-docs-api google-api-client google-api-php-client
BigQuery的API发现服务运行良好,但是最近突然返回错误。
Google的API发现服务具有fields参数。它在诸如发现(案例3)之类的某些api中效果很好,但在bigquery(案例1)中不起作用。
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "kind",
"description": "Error expanding 'fields' parameter. Cannot find matching fields for path 'kind'."
}
]
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
如果删除字段(案例2),则效果很好。
google-api-javascript-client有相同的问题。
我认为这是Google的错误,还是有任何错误?
google-api google-api-client google-bigquery google-apis-explorer
如何使用 cURL 从刷新令牌中获取新的访问令牌?
在 PHP 中,我会做这样的事情:
$client = new Google_Client();
$client->addScope(Google_Service_Analytics::ANALYTICS_READONLY);
$client->refreshToken($refresh_token);
$access_token = $client->getAccessToken();
Run Code Online (Sandbox Code Playgroud)
如何使用 cURL 完成同样的事情?
我无法从他们的文档中找到它。
curl google-api google-analytics-api google-api-client google-oauth
我正在尝试在我通过Sublime Text2编码并通过Apache运行的网站上实施Google+登录/登录按钮.我是非常新的Web开发和使用localhost/http://127.0.0.1.
所以我的问题就出现了,因为当我在"索引"Chrome HTML文档中有按钮时,它运行正常,我可以使用我的Google +帐户登录.
但是,如果我将网页中的按钮链接到该网页(新文档"登录"Chrome HTML文档),则登录不会通过.它会提取我的帐户,但它不会让我完全登录.
错误错误:origin_mismatch
我想我必须在我的API和Auth中使用我的证书中的JavaScript起源中更改一些内容,但它不会让我添加类似http://localhost/signin.html的内容 .
Origins URIs must not contain a path: http://localhost/signin.html
Run Code Online (Sandbox Code Playgroud)
我怎么能让这个网页访问?
谢谢!
google-api ×7
android ×2
java ×2
button ×1
curl ×1
geofencing ×1
google-oauth ×1
google-plus ×1
html ×1
magento ×1
oauth-2.0 ×1
php ×1