如何在DotNetOpenAuth属性交换中使用FavoriteFlavor属性
此代码展示了如何使用与 DotNetOpenAuth 的属性交换。
但是,如果我有自己的封闭提供程序并想要使用自定义属性,例如作为 DNOA 示例的一部分在 AcmeRequest
中定义的 FavoriteFlavor
属性,该怎么办?我必须与 DNOA 做什么才能使请求看起来像这样(但对于我的 favoriteflavor 请求):
openid.ns.ax=http://openid.net/srv/ax/1.0
openid.ax.mode=fetch_request
openid.ax.required=name,hackergotchi
openid.ax.if_available=email,web
openid.ax.type.name=http://axschema.org/namePerson
openid.ax.type.email=http://axschema.org/contact/email
openid.ax.type.hackergotchi=http://axschema.org/media/image/default
openid.ax.type.web=http://axschema.org/contact/web/default
This code shows how to use Attribute Exchange with DotNetOpenAuth.
But what if I have my own closed Provider and want to use custom attributes, for example the FavoriteFlavor
attribute defined in the AcmeRequest
as part of the DNOA samples; what do I have to do with DNOA to make the request look like something like (but for my FavoriteFlavor request):
openid.ns.ax=http://openid.net/srv/ax/1.0
openid.ax.mode=fetch_request
openid.ax.required=name,hackergotchi
openid.ax.if_available=email,web
openid.ax.type.name=http://axschema.org/namePerson
openid.ax.type.email=http://axschema.org/contact/email
openid.ax.type.hackergotchi=http://axschema.org/media/image/default
openid.ax.type.web=http://axschema.org/contact/web/default
as defined in http://blogs.gnome.org/jamesh/2007/11/26/openid-ax/:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定当您构建自己的 OpenID 提供程序时是否需要使 OpenID 请求与此完全相同。
您只需要使用 Fetch 和 Store(如果您想允许保存数据)请求和响应,非常简单。
在 OpendID 提供程序上,您必须捕获此请求并创建 FetchResponse
请记住,这些只是属性交换扩展所需的附加步骤。
I am not sure that you need to make the OpenID request look exactly like this when you are building your own OpenID provider.
You only need to use Fetch and Store (if you want to allowing saving of data) requests and response and it is very simple.
On the OpendID provider you have to catch this request and create FetchResponse
Keep in mind that these are just sort of additional steps needed for Attribute Exchange extension.