我一直在使用 Google+ API 在 C#(WPF) 中开发桌面应用程序。这是一个简单的应用程序,为 Googleplus+ 提供登录页面,当用户输入凭据并同意应用程序的权限请求时,它会检索并显示用户的个人资料信息。
使用 Google+ API,我能够从 Google+ 检索用户的个人资料信息。但是当我退出并再次打开应用程序时,它不是登录页面而是直接进入“请求批准”页面。
问题出在 Internet Explorer 中,因为它默认启用“保持登录”选项。我想在每次应用程序关闭时自动注销用户。
在谷歌搜索后,我发现通过将浏览器导航到这个“ https://accounts.google.com/Logout?&continue=http://www.google.com/ ”注销用户。
google+ 中是否有任何 API 可用于以编程方式注销用户,或者这是唯一的方法?
我正在尝试通过 Google 的 CardDAV API 从 Google 通讯录中检索所有联系人。
根据CardDAV 开发人员指南,这应该通过发送addressbook-multiget REPORT. 其中,根据RFC 6352,应该是这样的:
Run Code Online (Sandbox Code Playgroud)REPORT https://www.googleapis.com/carddav/v1/principals/foo@gmail.com/lists/default HTTP/1.1 Authorization: Bearer ya29.foo-bar Depth: 1 Content-Type: text/xml; charset=UTF-8 Host: www.googleapis.com Content-Length: 204 <C:addressbook-multiget xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav"> <D:prop> <D:getetag /> <C:address-data> <C:prop name="EMAIL"/> </C:address-data> </D:prop> </C:addressbook-multiget>
不幸的是,我不断收到(400) Bad Request所有REPORT请求。
我确实在请求中包含了带有 OAuth2 访问令牌的 Authorization 标头和设置为 1 的 Depth 标头,并且我https://www.googleapis.com/carddav/v1/principals/foo@gmail.com/lists/default通过 HTTPS将其发送到。而且我确实可以访问 Developer Console 中授予的 CardDAV API。
有没有人让这个工作和/或有什么我应该做的不同的线索?
当我在 gmail UI 中使用 label:sent 作为搜索查询时,它会带我发送邮件,但是当我使用从 gmail API 发送的 labelId 的邮件时(https://developers.google.com/gmail/api/v1 /reference/users/messages/list ) 我收到错误“标签无效:已发送”- 只是想知道如何从 API 查询已发送的项目?是否还有关于可用于 gmail API 的“q”输入参数的输入类型的参考/示例?
谢谢
Google 没有关于如何删除 node.JS 中的事件的文档
我已经能够使用以下代码将新事件添加到我的日历中:
calendar.events.insert({
auth: auth,
calendarId: 'primary',
resource: event,
}, function(err, event) {
if (err) {
console.log('There was an error contacting the Calendar service: ' + err);
return;
}
console.log('Event created: %s', event.htmlLink);
});
Run Code Online (Sandbox Code Playgroud)
我已经摆弄了 4 个小时了,正在寻找解决方案。
我正在开发生成有关 youtubers 频道的报告和统计信息的应用程序。我在 Google 文档中找不到,Youtube 用户如何从我的应用程序向他的 Youtube 帐户授予只读访问权限?(我的意思是像 facebook 应用程序)。
我有点困惑 Google API 中有多少种身份验证方式以及我应该使用哪种方式。
我正在尝试使用 laravel google socialite 驱动程序,我需要使用从 api 调用中获取的访问令牌从 google 获取用户数据。但是当我认为我做的一切都正确时,它给出了一个错误说Call to protected method Laravel\\Socialite\\Two\\GoogleProvider::getUserByToken()
我知道它说我无法访问该方法,因为它受到保护。那么如何解决这个问题。
我的目标
我的目标是验证我从我的移动应用程序获取的社交访问(基本上是谷歌)令牌,并将该用户的该特定用户的数据存储到我从社交名流 My Route 中收到的数据库中 api.php
Route::post('login','api\unAuthApiCall@index');
Run Code Online (Sandbox Code Playgroud)
我的控制器
namespace App\Http\Controllers\api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use Laravel\Socialite\Facades\Socialite;
class unAuthApiCall extends Controller
{
//Get the authentication token
public function index(Request $request){
//get the auth token
$authToken= Input::get('auth_token');
//Validate authtoken with google and get user's data
$driver = Socialite::driver('google');
$socialUserObject= $driver->getUserByToken($authToken);
return json_encode($socialUserObject);
}
}
Run Code Online (Sandbox Code Playgroud)
我得到的回应
{
"message": "Call to protected method Laravel\\Socialite\\Two\\GoogleProvider::getUserByToken() from context 'App\\Http\\Controllers\\api\\unAuthApiCall'", …Run Code Online (Sandbox Code Playgroud) 我想通过以下链接使用Xamarin的Google Play服务定位服务:
https://docs.microsoft.com/en-us/xamarin/android/platform/maps-and-location/location
IsGooglePlayServicesInstalled函数返回true,并安装了Xamarin.GooglePlayServices.Maps.
我究竟做错了什么?
android google-api xamarin google-play-services google-location-services
我正在尝试扩展它以用于同一公司内的多个用户.所有用户都将拥有该公司管理的Google帐户,并且我将为整个公司提供gsuite服务帐户.如何使用gsuite服务帐户根据电子邮件地址将文件上传到用户个人Google云端硬盘?
我正在 nodejs 应用程序中使用 googleapis,并且我正在尝试通过 gmail 帐户与日历进行交互。当我在本地机器上测试它时,它运行良好,但在部署它时出现错误
5|index | Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
5|index | at Sign.sign (crypto.js:331:26)
5|index | at Object.sign (/home/ec2-user/api/node_modules/jwa/index.js:55:45)
5|index | at Object.jwsSign [as sign] (/home/ec2-user/api/node_modules/jws/lib/sign-stream.js:23:24)
5|index | at GoogleToken.<anonymous> (/home/ec2-user/api/node_modules/gtoken/src/index.ts:251:13)
5|index | at step (/home/ec2-user/api/node_modules/gtoken/build/src/index.js:42:23)
5|index | at Object.next (/home/ec2-user/api/node_modules/gtoken/build/src/index.js:23:53)
5|index | at /home/ec2-user/api/node_modules/gtoken/build/src/index.js:17:71
5|index | at new Promise (<anonymous>)
Run Code Online (Sandbox Code Playgroud)
下面是我尝试使用它的控制器。
import { google } from 'googleapis'
import { Request, Response, NextFunction } from 'express';
export class HolidayController {
fetchHolidays(req: Request, res: Response, next: NextFunction) …Run Code Online (Sandbox Code Playgroud) 根据此处的文档
我使用通配符添加了http限制,如下所示:
这应该涵盖所有子域的所有路径,但是RefererNotAllowedMapError当我尝试使用时会收到错误消息https://www.dev.mydomain.com/#/
我什至尝试显式添加https://www.dev.mydomain.com/#/,但出现相同的错误。
我完全迷路了,不知道该怎么办。显然,其他人正在使用Google Maps API,并没有完全不受限制,因此必须有一种方法来做到这一点。
google-maps google-api google-maps-api-3 google-console-developer
google-api ×10
c# ×2
google-oauth ×2
node.js ×2
android ×1
carddav ×1
gmail-api ×1
google-maps ×1
google-plus ×1
java ×1
javascript ×1
laravel ×1
laravel-5.5 ×1
oauth-2.0 ×1
wpf ×1
xamarin ×1