AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[oauth](server)

Martin Hope
Graeme Perrow
Asked: 2021-10-17 11:46:34 +0800 CST

如何更改我的 redirect_uri 以进行 Google OAuth 2.0 身份验证?

  • 0

多年来,我一直在我的网站上使用 Google 的 OAuth 2.0 身份验证。最近它停止工作,因为我使用的 redirect_urihttp://和谷歌现在显然需要 https。我的站点支持 https,因此我将本地 client_secrets.json 文件更改为使用 https,还转到了有关凭据的 Google Cloud Platform 页面,选择了 OAuth 2.0 客户端 ID,并确保授权重定向 URI 下的条目也具有https://。重新启动我的网络服务器后,身份验证仍然失败,因为 redirect_uri 仍在使用http://.

这只是一个缓存问题,会在一小时/天后消失吗?我还需要做些什么来更新重定向 URI 或告诉 Google 刷新它吗?

google-cloud-platform oauth
  • 1 个回答
  • 979 Views
Martin Hope
JSM
Asked: 2020-10-06 23:18:37 +0800 CST

尝试使用 Google 身份提供商登录 Openshift 4.5 时出现 401 Unauthorized

  • 1

我最近部署了一个 4.5 版 OKD 集群,一切似乎都很好,但我无法让 Google 身份提供程序用于登录。我按照此处的说明进行操作,但没有成功。当我尝试使用我的公司 google 身份登录时,我收到一条非常通用的错误消息:

登录错误

我最终得到了以下 OAuth 配置:

spec:
  identityProviders:
  - google:
      clientID: <my-ID>.apps.googleusercontent.com
      clientSecret:
        name: google-secret
      hostedDomain: <company domain>
    mappingMethod: claim
    name: googleidp
    type: Google

我也按照描述设置了谷歌项目。刚刚创建了 Oauth2.0 凭据,回调 URL(这是正确的,因为我在同意屏幕后返回 OKD),没有额外的同意范围;只是个人资料、电子邮件和 openid,OKD 不请求任何其他范围。该项目设置为内部,因此只有公司用户可以登录。

经过一些调查后,我设法增加了 oauth-openshift pod 的详细程度,以下是失败尝试的日志中显示的内容:

       1 handler.go:156] Got auth data
I0929 15:30:10.036799       1 round_trippers.go:423] curl -k -v -XPOST  -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" 'https://www.googleapis.com/oauth2/v3/token'
I0929 15:30:10.071829       1 round_trippers.go:443] POST https://www.googleapis.com/oauth2/v3/token 401 Unauthorized in 35 milliseconds
I0929 15:30:10.071871       1 round_trippers.go:449] Response Headers:
I0929 15:30:10.071879       1 round_trippers.go:452]     Server: scaffolding on HTTPServer2
I0929 15:30:10.071885       1 round_trippers.go:452]     Cache-Control: private
I0929 15:30:10.071891       1 round_trippers.go:452]     X-Content-Type-Options: nosniff
I0929 15:30:10.071897       1 round_trippers.go:452]     Vary: Origin
I0929 15:30:10.071902       1 round_trippers.go:452]     Vary: X-Origin
I0929 15:30:10.071909       1 round_trippers.go:452]     Vary: Referer
I0929 15:30:10.071915       1 round_trippers.go:452]     Date: Tue, 29 Sep 2020 15:30:10 GMT
I0929 15:30:10.071920       1 round_trippers.go:452]     Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-27=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
I0929 15:30:10.071926       1 round_trippers.go:452]     Content-Type: application/json; charset=utf-8
I0929 15:30:10.071934       1 round_trippers.go:452]     X-Xss-Protection: 0
I0929 15:30:10.071939       1 round_trippers.go:452]     X-Frame-Options: SAMEORIGIN
I0929 15:30:10.072004       1 handler.go:176] Error getting access token: Unauthorized
E0929 15:30:10.072031       1 errorpage.go:26] AuthenticationError: Unauthorized
I0929 15:30:10.072428       1 httplog.go:90] verb="GET" URI="/oauth2callback/googleidp?state=<token>&code=<token>&scope=email%20profile%20openid%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile&authuser=0&hd=<companydomain>&prompt=consent" latency=35.835162ms resp=200 UserAgent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36" srcIP="10.129.2.28:49228": 

我找不到 Unauthorized 错误的原因,因此非常感谢任何帮助。

oauth openshift openshift-4
  • 1 个回答
  • 300 Views
Martin Hope
Patrick Hund
Asked: 2020-10-04 03:20:30 +0800 CST

使用 GCP / IAP 从访问限制中排除特定网页

  • 3

我有一个在 Google Cloud Platform App Engine上运行的 Node.js/Express 网络应用程序。

我正在使用Identity Aware Proxy (IAP)限制对该应用程序的访问,这样只有我公司中的人员在使用公司帐户登录 Google 时才能访问该网站。

这很好用,只有一件事让我烦恼:

对于限制访问的 OAuth 2 客户端,我配置了隐私和数据策略页面的 URL,该页面链接自 Google 登录表单,当用户尝试访问该网站时,该表单会显示给用户。

谷歌登录表单

此隐私页面也由我的 Web 应用程序提供,因此当尚未登录的人单击登录表单上显示的链接时,他们会被要求登录以查看隐私页面,因为我的所有 Web 应用程序的页面都受到保护由 IAP。鸡和蛋类型的问题。

有没有办法从 IAP 中排除特定 URL 并允许在不登录的情况下访问?

google-app-engine google-cloud-platform oauth
  • 1 个回答
  • 396 Views
Martin Hope
Diego Frehner
Asked: 2020-06-13 06:58:14 +0800 CST

配置 ADFS 以允许访问服务器应用程序并应用身份验证策略

  • 0

我的目标是将身份验证从我的 OIDC 身份提供者(使用身份服务器 4)委托给 ADFS。在 ADFS 中,我还想配置在该场景中必须使用 MFA。

根据文档和我的解释,我Server application在AD FS -> Application Groups. 该定义为我提供了一个客户端 ID 和客户端密码,这很好,因为我的 IDP 是一个机密客户端。委派工作正常。现在的问题是我无法配置应用于该客户端的身份验证策略,即用户在登录时必须使用 MFA。

Web Api客户端定义是唯一允许配置身份验证策略的(与Native application和相对)。(在此处Server application的示例中可见)。我不明白为什么存在可能的应用程序类型。Web api 不会从 ADFS 请求访问或 ID 令牌。它只需要验证令牌。但是和or之间似乎存在一些依赖关系(由于客户端-服务器应用程序模板)。Web APIWeb APINative applicationServer application

是否有可能以及如何使用身份验证策略配置机密客户端?

oauth adfs
  • 1 个回答
  • 516 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve