oauth 相关问题

OAuth(开放授权)是客户端应用程序代表用户访问受保护资源的规范。它是作为用户将登录凭据分发给第三方应用程序的替代方案而开发的。

我无法使用 Google 登录,它会重定向到登录页面而不是索引页面

我正在开发一个简单的个人项目,该项目将允许用户使用 Google GSI 库 OAauth 2.0 使用 google 帐户登录。我探索了有关如何使用 GSI 库并实现我的文档...

回答 1 投票 0

Flutter 使用 google_sign_in 包登录 google,返回的 idtoken 对于 android 为空

我有一个适用于 ios/android 的 flutter 移动应用程序。我决定使用 google_sign_in 包为 android 和 ios 添加使用 google 的社交登录。 我已经创建了两个客户端 ID,正在进行中...

回答 2 投票 0

来自 Microsoft 的罕见 AADSTS7000215 错误(提供了无效的客户端密钥)

有时尝试获取令牌: login.microsoftonline.com/common/oauth2/v2.0/token 我收到错误: AADSTS7000215:提供的客户端密钥无效 我确信 client_secret 是共同的...

回答 1 投票 0

在Python中创建一个airtable OAuth令牌

我有来自 Google 的代码,成功使用 google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file API 打开浏览器并创建存储在 ... 中的 Google API Oauth2 令牌

回答 1 投票 0

JWT 和 Bearer Token 有什么区别?

我正在学习一些有关授权的知识,例如 Basic、Digest、OAuth2.0、JWT 和 Bearer Token。 现在我有一个问题。 您知道 JWT 在 OAuth2.0 标准中被用作 Access_Token。 ...

回答 5 投票 0

为什么“appAuthRedirectScheme”作为清单占位符没有效果?

我正在尝试使用 flutter 构建一个简单的单点登录示例。因此,我需要在身份提供商进行身份验证后将用户重定向回我的应用程序。我使用 Flutter AppAuth 插件...

回答 2 投票 0

为什么下一个身份验证说需要 client_id,即使在不和谐的提供商中,显然有一个 client_id

当我尝试使用下一个身份验证创建不和谐的 oauth 客户端并单击登录时,出现此错误: https://next-auth.js.org/errors#get_authorization_url_error client_id 是必需的 { 消息:'

回答 8 投票 0

Dynamics CRM REST OAuth 身份验证响应 403 - 用户不是组织的成员

我正在尝试向 Microsoft Dynamics CRM REST API 发出请求。 我收到 403 响应,其中包含消息“该用户不是组织的成员”。 谁能建议一下...

回答 1 投票 0

EXPO AuthSession 在 Android 设备上返回解雇

我正在使用 Expo AuthSession 通过 IdentityServer4 实现登录我的应用程序。 当我尝试使用我的 Google 帐户登录 IdentityServer 时,仅在 ANDROID 中出现此问题。 AuthSe...

回答 2 投票 0

oauth2 的多个范围值

我尝试发布几个范围值以允许我申请一些谷歌服务...... 我尝试使用两个输入字段 我尝试发布几个范围值以允许我申请某些谷歌服务... 我尝试使用两个输入字段 <input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar" /> <input type="hidden" name="scope" value="https://www.googleapis.com/auth/userinfo.email" /> 并且有一个带有 + 分隔符的输入字段 <input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar+https://www.googleapis.com/auth/userinfo.email" /> 当我发送只有一个范围的表格时它就起作用了。 否则,使用 sereval 范围值,谷歌会使用此错误描述重定向我: http://localhost:49972/redirect.aspx#error=invalid_request&error_description=OAuth+2+parameters+can+only+have+a+single+value:+scope&error_uri=http://code.google.com/apis/accounts/docs/OAuth2.html 在 google 入门 中,使用 oAuth2 它可以使用两个范围值。 这是我的代码: <form id="form1" method="post" action="https://accounts.google.com/o/oauth2/auth?" > <div> <input type="hidden" name="response_type" value="code" /> <input type="hidden" name="client_id" value="my client id" /> <input type="hidden" name="redirect_uri" value="http://localhost:49972/redirect.aspx" /> <input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar" /> <input type="hidden" name="scope" value="https://www.googleapis.com/auth/userinfo.email" /> <input type="hidden" name="state" value="/profile" /> <input type="submit" value="go" /> </div> </form> 当您将它们组合到一个字段时,您就走在正确的轨道上 。请求中应该只有一个范围参数,各个值之间用空格分隔。如果您将其放入这样的形式,浏览器将为您负责对空间进行编码。 <input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/userinfo.email" /> 除了 Steve Bazyl 的回答。当为同一个 Google 服务应用多个作用域时,作用域的顺序似乎很重要。 F.e 该字符串按预期工作: "https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.metadata.readonly" 虽然这个对我不起作用: "https://www.googleapis.com/auth/drive.metadata.readonly https://www.googleapis.com/auth/drive" 但我在文档中没有找到任何相关信息。 为了清晰起见,您可以将所有范围放入 1 个数组中: const scopes = [ 'openid', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/gmail.readonly', ] const scope = scopes.join(' ') console.log(scope) // openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/gmail.readonly const redirectUri = 'http://localhost:3000' const link = `https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=${scope}&response_type=code&client_id=${GOOGLE.clientId}&redirect_uri=${redirectUri}&state=authGoogle` 对于在omniauth文件中设置正确范围属性有困难的任何人,请尝试在nunosilva的该线程建议的omniauth路径/url中设置范围字符串 https://github.com/zquestz/omniauth-google-oauth2/issues/143

回答 4 投票 0

CAS-SSO 和 Spring Security 与 Spring Boot 3.1 中的无限重定向登录循环

版本: 春季启动:3.1.1 春季安全:6.1.1 春季 OAuth:6.1.1 CAS 端点尝试了以下操作 1./j_spring_cas_security_check 2./登录/cas 以下注释 @

回答 1 投票 0

Spring 资源服务器 + Spring Security O2Auth (Google)。由于 JWT 无效,无法进行身份验证

我正在尝试为我的宠物项目实现“使用谷歌登录”授权。我决定首先练习一个小项目,因此我创建了一个仅包含一个控制器的简单 REST 应用程序。我哥们...

回答 1 投票 0

从 Azure 逻辑应用调用 HTTP oauth 2.0

我正在尝试连接到 Azure Web 应用程序,一旦检查网络配置正确(我能够连接到不安全的资源),我就会陷入“Active Directory Oauth&...

回答 1 投票 0

需要 Salesforce API 集成方面的帮助

我们目前正在开发电子邮件跟踪应用程序,我们的目标是将其与 Salesforce 集成。但是,我们遇到了一个问题,即我们收到错误消息...

回答 2 投票 0

OAuth:登录后无法看到 Google 电子邮件地址

我想从 Google 用户那里获取电子邮件地址。为此,我使用以下依赖项: org.springframework.boot 我想从 Google 用户那里获取电子邮件地址。为此,我使用此依赖项: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-oauth2-client</artifactId> <version>3.0.4</version> </dependency> 登录后,用户被重定向到此控制器: @Controller public class OAuthController { @GetMapping("/google") public ResponseEntity<String> google() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication instanceof OAuth2AuthenticationToken) { OAuth2User user = (OAuth2User) authentication.getPrincipal(); String email = user.getAttribute("email"); System.out.println(email); } else { System.out.println("No Email"); } return ResponseEntity.ok("Hello"); } 但是,我总是进入 else 语句。这是authentication的回归: 这是我的安全配置: @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http.csrf().disable(); http.sessionManagement().sessionAuthenticationStrategy(sessionAuthenticationStrategy()); http.authorizeHttpRequests(auth -> auth .requestMatchers("/api/welcome").authenticated() .anyRequest().permitAll() ); http.httpBasic(); http.logout().permitAll(); http.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class); http.oauth2Login(Customizer.withDefaults()); return http.build(); } 在 Google Cloud 的 OAuth 同意屏幕中,我添加了我的电子邮件地址作为测试用户,并添加了范围 .../auth/userinfo.email 和 .../auth/userinfo.profile。我的 application.yml 如下所示: spring: security: oauth2: client: registration: google: client-id: <my-client-id> client-secret: <my-client-secret> redirect-uri: http://localhost:8080/google scope: - email - profile 登录时,Google 会突出显示电子邮件地址将被共享。参见: 那么为什么我看不到电子邮件地址? OAuth2User实际上应该是OidcUser,它延伸了OAuth2User和IdTokenClaimAccessor。这意味着您应该能够执行以下操作: @Controller public class OAuthController { @GetMapping("/google") public ResponseEntity<String> google() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if ( authentication instanceof OAuth2AuthenticationToken oauth && oauth.getPrincipal() instanceof OidcUser oidcUser) { System.out.println(oidcUser.getEmail()); } else { System.out.println("No Email"); } return ResponseEntity.ok("Hello"); } }

回答 1 投票 0

JWT 刷新令牌轮换的家族是什么

我正在研究 JWT 访问令牌 (AC) 和轮换刷新令牌 (RT) - 这意味着对于每个更新 RT 请求,应用程序都会生成一对新的 RT 和 AC 令牌。 我看到一些博客、帖子提到...

回答 1 投票 0

使用自定义提供程序进行身份验证时,NextAuth 给出错误 OAUTH_CALLBACK_ERROR invalid_client

我正在尝试使用 NextAuth 通过自定义 oauth2 提供程序 (Whoop) 进行身份验证,但在 whoop 服务器上完成登录并且我被重定向回我的应用程序后,NextAuth 会抛出

回答 1 投票 0

“API 处理程序不应返回值,接收到的对象。”登录时下一个 JS 13.4

我收到此错误是因为我尝试在 nextJS 中通过 github 登录 /app/api/register/route.ts 从“bcrypt”导入bcrypt; 从“@/app/libs/prismadb”导入 prisma; 小鬼...

回答 0 投票 0

通过基于 API 的方法将 OAuth 令牌从后端传输到前端的最佳方式是什么?

这是我的步骤: 我从前端将用户重定向到 API 的端点,然后将他们重定向到相应的 Google/Facebook/Github 登录页面。 用户登录社交媒体后...

回答 1 投票 0

使用 SubtleCrypto(或其他浏览器 API)签署 Google JWT

我目前正在编写一个 Chrome 扩展程序,它将通过服务帐户从 Google OAuth 获取访问令牌。我基本上已经准备好了一切,除了我坚持签署 JWT。我有厕所...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.