【发布时间】:2020-03-04 21:11:45
【问题描述】:
我想使用 OAuth2 将 Google Calenar API 集成到我的 Angular .NET 应用程序中,这样每个用户在登录时都可以看到自己的日历。
我想将生成的代码保存到数据库中。
我开始这样做,并在角度方面添加了此功能,该功能可以连接到您的谷歌日历并获取您的私人代码,然后将其发送到背面:
handleAuthClick() {
let self = this;
gapi.auth2.getAuthInstance().grantOfflineAccess()
.then(value => {
const optionsParams = {
params: new HttpParams()
.set('code', value.code)
};
self.http.get("http://localhost:59933/api/UserCode", optionsParams)
.subscribe(data => {
console.log(data);
})
});
}
现在我想在用户登录应用程序时使用此代码检索日历数据(whiteout 需要在另一个时间连接到谷歌日历)
我从这个开始,但这里没有关于 OAuth2 的内容:
https://developers.google.com/calendar/quickstart/dotnet
有什么帮助吗?并感谢
【问题讨论】:
标签: angular asp.net-core google-calendar-api