简体   繁体   English

Strapi GraphQL-安全性(标头bearer_token)

[英]Strapi GraphQL - Security (header bearer_token)

Is there a way to secure GraphQL queries in Strapi? 有没有办法在Strapi中保护GraphQL查询?

I'm developing an application in Angular 6 (frontend) and Strapi (backend). 我正在Angular 6(前端)和Strapi(后端)中开发应用程序。 Ideally, i'd like to only allow queries with an authorised bearer_token. 理想情况下,我只允许使用授权的bearer_token查询。

Cheers, Rodrigo 干杯,罗德里戈

The Users and Permissions section of the admin panel is based on the controllers' actions, not of routes. 管理面板的“用户和权限”部分基于控制器的操作,而不是路由。 Because default GraphQL queries use these actions, you can use the Users & Permissions section to manage GraphQL security rules. 由于默认的GraphQL查询使用这些操作,因此您可以使用“用户和权限”部分来管理GraphQL安全规则。

If you want to add more custom logic or secure your custom GraphQL resolvers, take a look a this section of the documentation: https://strapi.io/documentation/guides/graphql.html#execute-a-policy-before-a-resolver . 如果要添加更多自定义逻辑或保护自定义GraphQL解析器,请查看文档的以下部分: https ://strapi.io/documentation/guides/graphql.html#execute-a-policy-before-a -解析器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Angular Post 请求中正确发送带有承载令牌的授权标头? - “403 Forbidden” - Strapi - How can I properly send Authorization Header with Bearer token in Angular Post Request? - "403 Forbidden" - Strapi SPA,Web API承载令牌安全性问题 - SPA, Web API Bearer Token security issues Angular 存储来自 header 的不记名令牌 - Angular store bearer token from header 如何从 JavaScript (Angular 2/4) 中的授权标头中检索承载令牌? - How to retrieve a Bearer Token from an Authorization Header in JavaScript (Angular 2/4)? Angular - 在 API 调用上的请求 header 中未发送不记名令牌 - Angular - Bearer token not sent in request header on API calls 无法通过使用HttpClient在ionic中设置Authorization Header来发送Bearer令牌 - Unable to send Bearer token by setting Authorization Header in ionic using HttpClient 将不记名令牌添加到标头无法按预期工作 - Adding the Bearer token to the header doesn't work as expected 如何在使用 Bearer 令牌作为授权标头调用资源 API 时在客户端/浏览器中保存 OAuth2 访问令牌 - How to save OAuth2 access token in Client / Browser when calling Resource APIs with Bearer token as Authorization Header Angular-不记名令牌 - Angular - Bearer token Angular中的不记名令牌 - Bearer token in Angular
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM