Openid 和数据类型
我正在尝试实现 Openid 服务器,问题是:交换特殊数据类型。
正如我对 openid 的理解,您只能将 ns 和 ax 数据模式交换为其他类型的数据,您应该为库实现一个新模式和新扩展以支持新模式。这是对的吗?添加这种特殊数据最容易的应该是什么?
谢谢你的时间
I'm trying to implement an Openid server and the problem is: Exchange special data types.
As i understood on openid you can only exchange ns and ax data schemas for other types of data you should implement a new schema and a new extension for the library to support the new schema. Is this right ? And what should be the easiest to add this special data ?
tks for ur time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AX 可以立即支持字符串和字符串列表。这对于大多数位都很有效,例如数字、名称等。由于 AX 使用 URL 作为键,因此您可以为该值定义自己的语义,只要它可以适合 URL 编码的字符串即可。因此,如果您的响应需要更多结构,您始终可以将值序列化为 JSON 对象并将它们打包到 AX 值中。请记住,这会很快使您的请求大小激增,并且您可能会在不知不觉中遇到 413 错误。
AX can support both strings and lists of strings out of the box. This works well for most bits, like numbers, names, and the like. Since AX uses URLs as its keys, you can define your own semantics to the value, as long as it can fit into a URLencoded string. Thus, if you need more structure in your response, you can always serialize your values as JSON objects and pack them into the AX values. Keep in mind that this will explode the size of your requests fairly quickly and you could run into 413 errors before you know it.