gpt4 book ai didi

Symfony 6.3 oidc token Handler(Symfony 6.3 oidc令牌处理程序)

转载 作者:bug小助手 更新时间:2023-10-22 14:28:32 35 4
gpt4 key购买 nike



i got a question about OpenIdConnect in the doc they say

他们说,我在文档中有一个关于OpenIdConnect的问题


By default, the OidcTokenHandler creates an OidcUser with the claims. To create your own User from the claims, you must create your own UserProvider: 

But when I call any route, I got an error: "main" firewall requires a user provider but none was defined. Like it missing the provider in the seurity.yaml configuration. But since I want to get the OidcUser provide by default I don't want to create my own UserProvider.

但当我调用任何路由时,我都会得到一个错误:“主”防火墙需要一个用户提供程序,但没有定义。就像它在seurity.yaml配置中缺少提供程序一样。但是,由于我想在默认情况下获得OidcUser,我不想创建自己的UserProvider。


There is a configuration to do. or a service to define as provider to get the OidcUser ?

有一个配置要做。或者有一个服务要定义为获取OidcUser的提供者?


This is my current security.yaml configuration:

这是我当前的security.yaml配置:



security:
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
firewalls:
main:
access_token:
token_handler:
oidc_user_info: https://keycloack.doamin.xxx/realms/Api/protocol/openid-connect/userinfo

# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
- { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/, roles: ROLE_USER }

更多回答

Without the actual contents of your security.yaml file, we are unable to help you or write up a helpfull answer. In addition, have a look at How to ask a good question, where you can find more usefull tips to provide more background information that can be useful for other readers.

如果没有您的security.yaml文件的实际内容,我们将无法帮助您或编写有用的答案。此外,看看如何提出一个好问题,在那里你可以找到更多有用的技巧,提供更多对其他读者有用的背景信息。

@Såpe I edited the question with my configuraiton file

@Såpe我用我的配置文件编辑了这个问题

@GrenierJ Did you found a solution to your problem? I'm curious, too.

@GrenierJ你找到解决问题的办法了吗?我也很好奇。

优秀答案推荐
更多回答

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com