小编DaI*_*mTo的帖子

Google API身份验证:客户端无效的来源

在向Google API(gapi)发出身份验证请求时,它会在checkOrigin上返回false.

我删除了任何客户端ID或任何直接链接到我的帐户的内容,并将其替换为正则表达式,以指示数据供参考.

网址: https://accounts.google.com/o/oauth2/iframerpc?action=checkOrigin&origin=https%3A%2F%2Flocal.tools&client_id=(\d{21})

我的原始网址是本地网址 https://local.tools

结果: {valid: false}

我正在使用此处找到的示例而没有偏差(除了用我的21位数字clientid替换clientid):https://ga-dev-tools.appspot.com/embed-api/third-party-visualizations/

我正在尝试显示的项目在演示站点上很好地显示,但是没有超过我的local.tools站点上的客户端错误的无效来源.

google-api google-analytics-api google-oauth google-api-js-client

42
推荐指数
9
解决办法
7万
查看次数

错误:错误:1E08010C:DECODER 例程::Google 身份验证库不支持

我最近在 Node.js 上使用 google 云存储 SDK 时遇到了这个错误。我知道这在过去没有任何改变的情况下是有效的,但我已经有一段时间没有接触代码了,可能是错误的。

这是错误本身:

Error: error:1E08010C:DECODER routines::unsupported
    at Sign.sign (node:internal/crypto/sig:131:29)
    at Object.sign (node_modules/jwa/index.js:152:45)
    at Object.jwsSign [as sign] (node_modules/jws/lib/sign-stream.js:32:24)
    at GoogleToken.requestToken (node_modules/gtoken/build/src/index.js:232:31)
    at GoogleToken.getTokenAsyncInner (node_modules/gtoken/build/src/index.js:166:21)
    at GoogleToken.getTokenAsync (node_modules/gtoken/build/src/index.js:145:55)
    at GoogleToken.getToken (node_modules/gtoken/build/src/index.js:97:21)
    at JWT.refreshTokenNoCache (node_modules/google-auth-library/build/src/auth/jwtclient.js:172:36)
    at JWT.refreshToken (node_modules/google-auth-library/build/src/auth/oauth2client.js:153:24)
    at JWT.getRequestMetadataAsync (node_modules/google-auth-library/build/src/auth/oauth2client.js:298:28) {
  library: 'DECODER routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_UNSUPPORTED'
}
Run Code Online (Sandbox Code Playgroud)

引发此错误的代码如下:

Error: error:1E08010C:DECODER routines::unsupported
    at Sign.sign (node:internal/crypto/sig:131:29)
    at Object.sign (node_modules/jwa/index.js:152:45)
    at Object.jwsSign [as sign] (node_modules/jws/lib/sign-stream.js:32:24)
    at GoogleToken.requestToken (node_modules/gtoken/build/src/index.js:232:31)
    at GoogleToken.getTokenAsyncInner (node_modules/gtoken/build/src/index.js:166:21)
    at GoogleToken.getTokenAsync (node_modules/gtoken/build/src/index.js:145:55)
    at GoogleToken.getToken (node_modules/gtoken/build/src/index.js:97:21)
    at …
Run Code Online (Sandbox Code Playgroud)

node.js google-cloud-storage google-api-nodejs-client

32
推荐指数
3
解决办法
4万
查看次数

OAuth中的"离线"访问是什么意思?

对于OAuth服务器授予的离线访问,"离线"一词到底意味着什么?

这是否意味着即使用户退出第三方应用程序或用户从OAuth资源服务器(如Facebook或Google或Twitter)注销,资源服务器也将返回有关用户的数据?

oauth google-api google-oauth google-oauth2

31
推荐指数
2
解决办法
2万
查看次数

带溢出的DIV:自动和100%宽的桌子

我希望有人能够在这里帮助我.我尽力简化我的例子.

我有一个绝对定位的DIV,在这个例子中我填写了浏览器窗口.这个div有overflow:auto属性,当内容太大而无法显示DIV时提供滚动条.

在DIV中我有一个表来呈现一些数据,它的宽度是100%.

当内容垂直变得太大时,我希望显示垂直滚动条,并且表格略微水平缩小以容纳滚动条.但是在IE7中会发生的情况是水平滚动条也会出现,尽管div中的所有内容仍然有足够的水平空间.

这是IE特定的 - firefox工作得很好.

完整来源如下.任何帮助非常感谢.

托尼

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Table sizing bug?</title>
    <style>
        #maxsize
        {
            position: absolute;
            left: 5px;
            right: 5px;
            top: 5px;
            bottom: 5px;
            border: 5px solid silver;
            overflow: auto;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="maxsize">
        <p>This will be fine until such time as the vertical size forces a
           vertical scroll bar. At this point I'd expect the table to re-size
           to now take …
Run Code Online (Sandbox Code Playgroud)

html xhtml internet-explorer html-table

29
推荐指数
5
解决办法
7万
查看次数

来自Google API Oauth的客户端不是有效来源

我从Google API Oauth收到此错误:

idpiframe_initialization_failed",详细信息:"不是客户端的有效来源:http://127.0.0....为项目的客户端ID列出此来源

我正在尝试从此本地路径发送请求:

http://127.0.0.1:8887/

我已将此URL添加到Authorized JavaScript origin部分: 在此输入图像描述

这是我的代码:

<!-- The top of file index.html -->
<html itemscope itemtype="http://schema.org/Article">
<head>
  <!-- BEGIN Pre-requisites -->
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">
  </script>
  <script src="https://apis.google.com/js/client:platform.js?onload=start" async defer>
  </script>
  <!-- END Pre-requisites -->

<!-- Continuing the <head> section -->
  <script>
    function start() {
      gapi.load('auth2', function() {
        auth2 = gapi.auth2.init({
          client_id: 'MY CLIENT ID.apps.googleusercontent.com',
          // Scopes to request in addition to 'profile' and 'email'
          //scope: 'https://www.google.com/m8/feeds/'
        });
      });
    }
  </script>




</head>
<body>


<button id="signinButton">Sign in …
Run Code Online (Sandbox Code Playgroud)

javascript oauth-2.0 google-oauth

29
推荐指数
6
解决办法
3万
查看次数

我真的不能发送带有客户端ID的开源软件吗?

开发人员凭据(例如密码,密钥和客户端ID)旨在供您使用并标识您的API客户端.您将保密您的凭据并做出合理的努力来防止和阻止其他API客户端使用您的凭据.开发人员凭据可能未嵌入开源项目中.

(https://developers.google.com/terms/,我的重点)

这是否意味着我的开源驱动器命令行客户端需要强制我的软件的每个用户在Google云端控制台中设置一个新项目?有更好的选择吗?

它不是很难从非开源中提取客户端ID和客户端"秘密",为什么区别呢?

"安装应用程序"客户端ID和机密并不是真正的秘密,Google文档似乎同意:

该过程会生成客户端ID,在某些情况下会导致客户端机密,您将其嵌入应用程序的源代码中.(在这种情况下,客户端秘密显然不被视为秘密.)

(https://developers.google.com/accounts/docs/OAuth2,我的重点)

open-source oauth google-api clientid google-oauth

25
推荐指数
2
解决办法
3066
查看次数

如何从.Net core 2.0中的HttpContext获取访问令牌

我正在尝试将.Net核心1.1的项目升级到.Net核心2.0,有很多重大变化.我目前遇到的一个问题HttpContext.Authentication是现在已经过时了.

我一直试图弄清楚如何获取当前请求的Access令牌.我需要调用另一个需要持有令牌的API.

旧方法.Net核心1.1

[Authorize]
public async Task<IActionResult> ClientUpdate(ClientModel client)
{
    var accessToken = await HttpContext.Authentication.GetTokenAsync("access_token");

    return View();
}
Run Code Online (Sandbox Code Playgroud)

方法.Net核心2.0

这不起作用因为上下文未注册.

[Authorize]
public async Task<IActionResult> ClientUpdate(ClientModel client)
{
    var accessToken = await context.HttpContext.GetTokenAsync("access_token"); 

    return View();
}
Run Code Online (Sandbox Code Playgroud)

无法解析"Microsoft.AspNetCore.Http.HttpContext"类型的服务

我尝试注册它,但这也不起作用

public ConsoleController(IOptions<ServiceSettings> serviceSettings, HttpContext context) 
Run Code Online (Sandbox Code Playgroud)

在startup.cs中

services.TryAddSingleton<HttpContext, HttpContext>();
Run Code Online (Sandbox Code Playgroud)

更新:

返回null

var accessToken = await HttpContext.GetTokenAsync("access_token");  
Run Code Online (Sandbox Code Playgroud)

Startup.cs ConfigureServices

如果在初创公司中有什么东西我也不会感到惊讶,因为这里也有很多重大变化.

services.Configure<ServiceSettings>(Configuration.GetSection("ServiceSettings"));
//services.TryAddSingleton<HttpContext, HttpContext>();
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddMvc();
services.AddAuthentication(options =>
            {

                options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
            })
            .AddCookie()
            .AddOpenIdConnect(options =>
            {
                options.Authority = "http://localhost:5000"; …
Run Code Online (Sandbox Code Playgroud)

c# http .net-core asp.net-core

25
推荐指数
5
解决办法
3万
查看次数

如何在SSIS中插入新记录之前清空目标表?

我使用SSIS生成和转换新数据,以便以后在新系统中使用.每次运行我的SSIS包时都会出现问题,它会不断地将新记录插入到我的目标表中.

如何先清空目标表(/ OLE DB目标),然后插入新生成的记录?

目前,此问题的解决方法是delete from DestTable在运行我的包之前执行.

database sql-server ssis relational-database

22
推荐指数
3
解决办法
7万
查看次数

如何更改Google同意屏幕电子邮件?

我创建了新的Google Play游戏,并希望更改Google Consent Screen上显示的电子邮件.Google Developers Console 屏幕上有一个下拉列表可供选择电子邮件,但只有一个 - 管理员的电子邮件 - 就在这里.我添加了另一个用户作为所有者,但它没有出现在同意屏幕上.

oauth google-api google-oauth google-oauth2 google-developers-console

22
推荐指数
5
解决办法
7042
查看次数

如何检测是否调试

我有一个.Net Core控制台应用程序.在我的startup.cs中的configure方法中,我试图测试是否启用了调试器:

 if (HttpContext.Current.IsDebuggingEnabled)
     loggerFactory.AddConsole(Configuration);
 else
     loggerFactory.AddConsoleJson(Configuration);
Run Code Online (Sandbox Code Playgroud)

HttpContext.Current.IsDebuggingEnabled在.Net核心中不支持接缝.我还没有找到一个在.net核心中运行的方法.

System.Diagnostics.DebuggableAttribute.DebuggingModes.Default 似乎也不起作用.

c# .net-core asp.net-core

19
推荐指数
3
解决办法
6587
查看次数