when I use ExchangeUserCredentialForToken on the client, to obtain a token, DNOA calls IAuthorizationServerHost.TryAuthorizeResourceOwnerCredentialGrant on the auth-server. I use this method, to find out, whether the username and the Password are correct and to return the "canonical" user-Name.
Exactly this user-Name is what I need within my implementation of IAuthorizationServerHost.CreateAccessToken, which is also called by DNOA after that. I need it, because, I want to set extra-data this user.
What is the supposed way, to have access to the user-Name from within this method?
Shell I set the CurrentPrincipal within TryAuthorizeResourceOwnerCredentialGrant or shell I just put the user-name into a member-variable?
On Fri, Jul 27, 2012 at 10:48 AM, Fred <manfred.ste...@gmx.net> wrote:
> Exactly this user-Name is what I need within my implementation of
> IAuthorizationServerHost.CreateAccessToken, which is also called by DNOA
> after that. I need it, because, I want to set extra-data this user.
Setting extra data in the access token will *not* be effective if you want
the client to be able to read it.
> What is the supposed way, to have access to the user-Name from within this
> method?
I'm a little surprised in retrospect (although maybe there was a reason for
it) to see that CreateAccessToken doesn't have access to the username here,
but you're right. Let's address that if you still want this after this
reply.
> Shell I set the CurrentPrincipal within
> TryAuthorizeResourceOwnerCredentialGrant or shell I just put the user-name
> into a member-variable?
No, and no. Setting CurrentPrincipal would fool your web app into
believing the client *was* the user, which would circumvent all OAuth 2
scoping and open you up to security holes. Setting it in a member variable
would not work if you had even just two people authorizing concurrently.
Finally, it sounds like you're trying to misuse OAuth 2 as an
authentication protocol. OAuth 2 authorization servers should *not* be
used to tell the client the username of the user. If you want to
authenticate the user please use OpenID.
Alternatively, the not-recommmended way to do this with OAuth 2 (ala
Facebook) is to return the username that authorized the access token from
the *resource server* rather than directly from the authorization server
with the access token response. So after the client gets the access token,
it calls some documented URL on the resource server to (for example) get
JSON back with the username *and the client_id that was issued the access
token*. The client must also check that the response's client_id matches
its own client_id (if you are in fact misusing the protocol for
authentication) to avoid a very common security exploit when using OAuth 2
for authentication.
Hi Andrew, thanks for your reply. The extra-data is for the ressource-server. For instance, the token could get the scope *http://whatever/movies*<http://whatever/movies>and the extra-data-entry: age=14. This could tell the ressource-server to just display a specific sub-set of the movies.
>> Alternatively, the not-recommmended way to do this with OAuth 2 (ala
Facebook) is to return the
>> username that authorized the access token from the *resource server [...]
*
Google uses this solution too and it seems, that this solution is pretty close to the current proposal of OpenId Connect. Does that mean, that OpenId Connect shows, how to mis-use OAuth2 for Authorization the right way?
I would be very interested in your opinion towards this ...
On Sat, Jul 28, 2012 at 10:41 AM, Fred <manfred.ste...@gmx.net> wrote:
> Hi Andrew,
> thanks for your reply. The extra-data is for the ressource-server. For
> instance, the token could get the scope *http://whatever/movies*<http://whatever/movies>and the extra-data-entry: age=14. This could tell the ressource-server to
> just display a specific sub-set of the movies.
Perfect. Then yes, setting ExtraData in the access token is the right way
to go.
> >> Alternatively, the not-recommmended way to do this with OAuth 2 (ala
> Facebook) is to return the
> >> username that authorized the access token from the *resource server
> [...]*
> Google uses this solution too and it seems, that this solution is pretty
> close to the current proposal of OpenId Connect.
> Does that mean, that OpenId Connect shows, how to mis-use OAuth2 for
> Authorization the right way?
Sort of ironic, but yes. OpenID Connect builds on top of OAuth 2 in such a
way as to maintain the security of using it for an authentication protocol.
>> Perfect. Then yes, setting ExtraData in the access token is the right
way to go.
thanks. But that leads to the original question - How to get access to the
user-name within CreateAccessToken?
Wishes,
Fred
Von: dotnetopenid@googlegroups.com [mailto:dotnetopenid@googlegroups.com] Im
Auftrag von Andrew Arnott
Gesendet: Montag, 30. Juli 2012 00:32
An: dotnetopenid@googlegroups.com
Betreff: Re: [dotnetopenauth] How to get user-name in CreateAccessToken
On Sat, Jul 28, 2012 at 10:41 AM, Fred <manfred.ste...@gmx.net> wrote:
Hi Andrew,
thanks for your reply. The extra-data is for the ressource-server. For
instance, the token could get the scope <http://whatever/movies>
http://whatever/movies and the extra-data-entry: age=14. This could tell the
ressource-server to just display a specific sub-set of the movies.
Perfect. Then yes, setting ExtraData in the access token is the right way
to go.
>> Alternatively, the not-recommmended way to do this with OAuth 2 (ala
Facebook) is to return the
>> username that authorized the access token from the resource server [...]
Google uses this solution too and it seems, that this solution is pretty
close to the current proposal of OpenId Connect.
Does that mean, that OpenId Connect shows, how to mis-use OAuth2 for
Authorization the right way?
Sort of ironic, but yes. OpenID Connect builds on top of OAuth 2 in such a
way as to maintain the security of using it for an authentication protocol.
-- You received this message because you are subscribed to the Google Groups
"DotNetOpenAuth" group.
To post to this group, send email to <mailto:dotnetopenid@googlegroups.com>
dotnetopenid@googlegroups.com.
To unsubscribe from this group, send email to
<mailto:dotnetopenid+unsubscribe@googlegroups.com>
dotnetopenid+unsubscribe@googlegroups.com.
For more options, visit this group at
<http://groups.google.com/group/dotnetopenid?hl=en>
http://groups.google.com/group/dotnetopenid?hl=en.
http://bit.ly/dnoawish --
Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death
your right to say it." - S. G. Tallentyre
On Sun, Jul 29, 2012 at 4:13 PM, Manfred Steyer <manfred.ste...@gmx.net>wrote:
> >> Perfect. Then yes, setting ExtraData in the access token is the right
> way to go. ****
> ** **
> thanks. But that leads to the original question – How to get access to the
> user-name within CreateAccessToken?****
> ** **
> Wishes,****
> Fred****
> ** **
> *Von:* dotnetopenid@googlegroups.com [mailto:dotnetopenid@googlegroups.com]
> *Im Auftrag von *Andrew Arnott
> *Gesendet:* Montag, 30. Juli 2012 00:32
> *An:* dotnetopenid@googlegroups.com
> *Betreff:* Re: [dotnetopenauth] How to get user-name in CreateAccessToken*
> ***
> ** **
> On Sat, Jul 28, 2012 at 10:41 AM, Fred <manfred.ste...@gmx.net> wrote:****
> Hi Andrew,****
> thanks for your reply. The extra-data is for the ressource-server. For
> instance, the token could get the scope http://whatever/movies and the
> extra-data-entry: age=14. This could tell the ressource-server to just
> display a specific sub-set of the movies.****
> ** **
> Perfect. Then yes, setting ExtraData in the access token is the right way
> to go. ****
> ****
> ****
> >> Alternatively, the not-recommmended way to do this with OAuth 2 (ala
> Facebook) is to return the ****
> >> username that authorized the access token from the *resource server
> [...]*****
> ****
> Google uses this solution too and it seems, that this solution is pretty
> close to the current proposal of OpenId Connect.****
> Does that mean, that OpenId Connect shows, how to mis-use OAuth2 for
> Authorization the right way?****
> ** **
> Sort of ironic, but yes. OpenID Connect builds on top of OAuth 2 in such
> a way as to maintain the security of using it for an authentication
> protocol. ****
> --
> You received this message because you are subscribed to the Google Groups
> "DotNetOpenAuth" group.
> To post to this group, send email to dotnetopenid@googlegroups.com.
> To unsubscribe from this group, send email to
> dotnetopenid+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/dotnetopenid?hl=en.****
> --
> You received this message because you are subscribed to the Google Groups
> "DotNetOpenAuth" group.
> To post to this group, send email to dotnetopenid@googlegroups.com.
> To unsubscribe from this group, send email to
> dotnetopenid+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/dotnetopenid?hl=en.
I also require access to the username in the CreateAccessToken method however I can't find an open ticket - can someone please advise what the current status of this is?
On Monday, July 30, 2012 12:19:29 AM UTC+1, Andrew Arnott wrote:
> I guess file a ticket for that one.
> http://bit.ly/dnoawish > --
> Andrew Arnott
> "I [may] not agree with what you have to say, but I'll defend to the death > your right to say it." - S. G. Tallentyre
> On Sun, Jul 29, 2012 at 4:13 PM, Manfred Steyer <manfred...@gmx.net<javascript:>
> > wrote:
>> Hi Andrew,****
>> ** **
>> >> Perfect. Then yes, setting ExtraData in the access token is the right >> way to go. ****
>> ** **
>> thanks. But that leads to the original question – How to get access to >> the user-name within CreateAccessToken?****
>> ** **
>> Wishes,****
>> Fred****
>> ** **
>> *Von:* dotnet...@googlegroups.com <javascript:> [mailto:
>> dotnet...@googlegroups.com <javascript:>] *Im Auftrag von *Andrew Arnott
>> *Gesendet:* Montag, 30. Juli 2012 00:32
>> *An:* dotnet...@googlegroups.com <javascript:>
>> *Betreff:* Re: [dotnetopenauth] How to get user-name in CreateAccessToken
>> ****
>> ** **
>> On Sat, Jul 28, 2012 at 10:41 AM, Fred <manfred...@gmx.net <javascript:>> >> wrote:****
>> Hi Andrew,****
>> thanks for your reply. The extra-data is for the ressource-server. For >> instance, the token could get the scope http://whatever/movies and the >> extra-data-entry: age=14. This could tell the ressource-server to just >> display a specific sub-set of the movies.****
>> ** **
>> Perfect. Then yes, setting ExtraData in the access token is the right >> way to go. ****
>> ****
>> ****
>> >> Alternatively, the not-recommmended way to do this with OAuth 2 (ala >> Facebook) is to return the ****
>> >> username that authorized the access token from the *resource server >> [...]*****
>> ****
>> Google uses this solution too and it seems, that this solution is pretty >> close to the current proposal of OpenId Connect.****
>> Does that mean, that OpenId Connect shows, how to mis-use OAuth2 for >> Authorization the right way?****
>> ** **
>> Sort of ironic, but yes. OpenID Connect builds on top of OAuth 2 in such >> a way as to maintain the security of using it for an authentication >> protocol. ****
>> -- >> You received this message because you are subscribed to the Google Groups >> "DotNetOpenAuth" group.
>> To post to this group, send email to dotnetopenid@googlegroups.com<javascript:>
>> .
>> To unsubscribe from this group, send email to >> dotnetopenid+unsubscribe@googlegroups.com <javascript:>.
>> For more options, visit this group at >> http://groups.google.com/group/dotnetopenid?hl=en.****
>> -- >> You received this message because you are subscribed to the Google Groups >> "DotNetOpenAuth" group.
>> To post to this group, send email to dotnet...@googlegroups.com<javascript:>
>> .
>> To unsubscribe from this group, send email to >> dotnetopenid...@googlegroups.com <javascript:>.
>> For more options, visit this group at >> http://groups.google.com/group/dotnetopenid?hl=en.
On Friday, October 19, 2012, lawst wrote:
> I also require access to the username in the CreateAccessToken method
> however I can't find an open ticket - can someone please advise what the
> current status of this is?
> thanks
> On Monday, July 30, 2012 12:19:29 AM UTC+1, Andrew Arnott wrote:
>> I guess file a ticket for that one.
>> http://bit.ly/dnoawish >> --
>> Andrew Arnott
>> "I [may] not agree with what you have to say, but I'll defend to the
>> death your right to say it." - S. G. Tallentyre
>> On Sun, Jul 29, 2012 at 4:13 PM, Manfred Steyer <manfred...@gmx.net>wrote:
>>> Hi Andrew,****
>>> ** **
>>> >> Perfect. Then yes, setting ExtraData in the access token is the
>>> right way to go. ****
>>> ** **
>>> thanks. But that leads to the original question – How to get access to
>>> the user-name within CreateAccessToken?****
>>> ** **
>>> Wishes,****
>>> Fred****
>>> ** **
>>> *Von:* dotnet...@googlegroups.com [mailto:dotnet...@**googlegroups.com]
>>> *Im Auftrag von *Andrew Arnott
>>> *Gesendet:* Montag, 30. Juli 2012 00:32
>>> *An:* dotnet...@googlegroups.com
>>> *Betreff:* Re: [dotnetopenauth] How to get user-name in
>>> CreateAccessToken****
>>> ** **
>>> On Sat, Jul 28, 2012 at 10:41 AM, Fred <manfred...@gmx.net> wrote:****
>>> Hi Andrew,****
>>> thanks for your reply. The extra-data is for the ressource-server. For
>>> instance, the token could get the scope http://whatever/movies and the
>>> extra-data-entry: age=14. This could tell the ressource-server to just
>>> display a specific sub-set of the movies.****
>>> ** **
>>> Perfect. Then yes, setting ExtraData in the access token is the right
>>> way to go. ****
>>> ****
>>> ****
>>> >> Alternatively, the not-recommmended way to do this with OAuth 2 (ala
>>> Facebook) is to return the ****
>>> >> username that authorized the access token from the *resource server
>>> [...]*****
>>> ****
>>> Google uses this solution too and it seems, that this solution is pretty
>>> close to the current proposal of OpenId Connect.****
>>> Does that mean, that OpenId Connect shows, how to mis-use OAuth2 for
>>> Authorization the right way?****
>>> ** **
>>> Sort of ironic, but yes. OpenID Connect builds on top of OAuth 2 in
>>> such a way as to maintain the security of using it for an authentication
>>> protocol. ****
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "DotNetOpenAuth" group.
>>> To post to this group, send email to dotnetopenid@googlegroups.com.
>>> To unsubscribe from this group, send email to dotnetopenid+unsubscribe@*
>>> *googlegroups.com.
>>> For more options, visit this group at http://groups.google.com/** >>> group/dotnetopenid?hl=en<http://groups.google.com/group/dotnetopenid?hl=en>
>>> .****
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "DotNetOpenAuth" group.
>>> To post to this group, send email to dotnet...@googlegroups.com.
>>> To unsubscribe from this group, send email to dotnetopenid...@**
>>> googlegroups.com.
>>> For more options, visit this group at http://groups.google.com/** >>> group/dotnetopenid?hl=en<http://groups.google.com/group/dotnetopenid?hl=en>
>>> .
>> --
> You received this message because you are subscribed to the Google Groups
> "DotNetOpenAuth" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/dotnetopenid/-/lqUV2XN_TOcJ.
> To post to this group, send email to dotnetopenid@googlegroups.com<javascript:_e({}, 'cvml', 'dotnetopenid@googlegroups.com');>
> .
> To unsubscribe from this group, send email to
> dotnetopenid+unsubscribe@googlegroups.com <javascript:_e({}, 'cvml',
> 'dotnetopenid%2Bunsubscribe@googlegroups.com');>.
> For more options, visit this group at
> http://groups.google.com/group/dotnetopenid?hl=en.
-- --
Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death
your right to say it." - S. G. Tallentyre
>> I also require access to the username in the CreateAccessToken method >> however I can't find an open ticket - can someone please advise what the >> current status of this is?
>> thanks
>> On Monday, July 30, 2012 12:19:29 AM UTC+1, Andrew Arnott wrote:
>>> I guess file a ticket for that one.
>>> http://bit.ly/dnoawish >>> --
>>> Andrew Arnott
>>> "I [may] not agree with what you have to say, but I'll defend to the >>> death your right to say it." - S. G. Tallentyre
>>> On Sun, Jul 29, 2012 at 4:13 PM, Manfred Steyer <manfred...@gmx.net>wrote:
>>>> Hi Andrew,****
>>>> ** **
>>>> >> Perfect. Then yes, setting ExtraData in the access token is the >>>> right way to go. ****
>>>> ** **
>>>> thanks. But that leads to the original question – How to get access to >>>> the user-name within CreateAccessToken?****
>>>> ** **
>>>> Wishes,****
>>>> Fred****
>>>> ** **
>>>> *Von:* dotnet...@googlegroups.com [mailto:dotnet...@**googlegroups.com] >>>> *Im Auftrag von *Andrew Arnott
>>>> *Gesendet:* Montag, 30. Juli 2012 00:32
>>>> *An:* dotnet...@googlegroups.com
>>>> *Betreff:* Re: [dotnetopenauth] How to get user-name in >>>> CreateAccessToken****
>>>> ** **
>>>> On Sat, Jul 28, 2012 at 10:41 AM, Fred <manfred...@gmx.net> wrote:****
>>>> Hi Andrew,****
>>>> thanks for your reply. The extra-data is for the ressource-server. For >>>> instance, the token could get the scope http://whatever/movies and the >>>> extra-data-entry: age=14. This could tell the ressource-server to just >>>> display a specific sub-set of the movies.****
>>>> ** **
>>>> Perfect. Then yes, setting ExtraData in the access token is the right >>>> way to go. ****
>>>> ****
>>>> ****
>>>> >> Alternatively, the not-recommmended way to do this with OAuth 2 (ala >>>> Facebook) is to return the ****
>>>> >> username that authorized the access token from the *resource server >>>> [...]*****
>>>> ****
>>>> Google uses this solution too and it seems, that this solution is >>>> pretty close to the current proposal of OpenId Connect.****
>>>> Does that mean, that OpenId Connect shows, how to mis-use OAuth2 for >>>> Authorization the right way?****
>>>> ** **
>>>> Sort of ironic, but yes. OpenID Connect builds on top of OAuth 2 in >>>> such a way as to maintain the security of using it for an authentication >>>> protocol. ****
>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "DotNetOpenAuth" group.
>>>> To post to this group, send email to dotnetopenid@googlegroups.com.
>>>> To unsubscribe from this group, send email to dotnetopenid+unsubscribe@
>>>> **googlegroups.com.
>>>> For more options, visit this group at http://groups.google.com/** >>>> group/dotnetopenid?hl=en<http://groups.google.com/group/dotnetopenid?hl=en>
>>>> .****
>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "DotNetOpenAuth" group.
>>>> To post to this group, send email to dotnet...@googlegroups.com.
>>>> To unsubscribe from this group, send email to dotnetopenid...@**
>>>> googlegroups.com.
>>>> For more options, visit this group at http://groups.google.com/** >>>> group/dotnetopenid?hl=en<http://groups.google.com/group/dotnetopenid?hl=en>
>>>> .
>>> -- >> You received this message because you are subscribed to the Google Groups >> "DotNetOpenAuth" group.
>> To view this discussion on the web visit >> https://groups.google.com/d/msg/dotnetopenid/-/lqUV2XN_TOcJ.
>> To post to this group, send email to dotnetopenid@googlegroups.com.
>> To unsubscribe from this group, send email to >> dotnetopenid+unsubscribe@googlegroups.com.
>> For more options, visit this group at >> http://groups.google.com/group/dotnetopenid?hl=en.
> -- > --
> Andrew Arnott
> "I [may] not agree with what you have to say, but I'll defend to the death > your right to say it." - S. G. Tallentyre
Yes, someone else was asking about it on Stackoverflow and I saw it wasn't
there yet.
--
Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death
your right to say it." - S. G. Tallentyre
>>> I also require access to the username in the CreateAccessToken method
>>> however I can't find an open ticket - can someone please advise what the
>>> current status of this is?
>>> thanks
>>> On Monday, July 30, 2012 12:19:29 AM UTC+1, Andrew Arnott wrote:
>>>> I guess file a ticket for that one.
>>>> http://bit.ly/dnoawish >>>> --
>>>> Andrew Arnott
>>>> "I [may] not agree with what you have to say, but I'll defend to the
>>>> death your right to say it." - S. G. Tallentyre
>>>> On Sun, Jul 29, 2012 at 4:13 PM, Manfred Steyer <manfred...@gmx.net>wrote:
>>>>> Hi Andrew,****
>>>>> ** **
>>>>> >> Perfect. Then yes, setting ExtraData in the access token is the
>>>>> right way to go. ****
>>>>> ** **
>>>>> thanks. But that leads to the original question – How to get access to
>>>>> the user-name within CreateAccessToken?****
>>>>> ** **
>>>>> Wishes,****
>>>>> Fred****
>>>>> ** **
>>>>> *Von:* dotnet...@googlegroups.com [mailto:dotnet...@**googlegroups**
>>>>> .com] *Im Auftrag von *Andrew Arnott
>>>>> *Gesendet:* Montag, 30. Juli 2012 00:32
>>>>> *An:* dotnet...@googlegroups.com
>>>>> *Betreff:* Re: [dotnetopenauth] How to get user-name in
>>>>> CreateAccessToken****
>>>>> ** **
>>>>> On Sat, Jul 28, 2012 at 10:41 AM, Fred <manfred...@gmx.net> wrote:****
>>>>> Hi Andrew,****
>>>>> thanks for your reply. The extra-data is for the ressource-server. For
>>>>> instance, the token could get the scope http://whatever/movies and
>>>>> the extra-data-entry: age=14. This could tell the ressource-server to just
>>>>> display a specific sub-set of the movies.****
>>>>> ** **
>>>>> Perfect. Then yes, setting ExtraData in the access token is the right
>>>>> way to go. ****
>>>>> ****
>>>>> ****
>>>>> >> Alternatively, the not-recommmended way to do this with OAuth 2
>>>>> (ala Facebook) is to return the ****
>>>>> >> username that authorized the access token from the *resource
>>>>> server [...]*****
>>>>> ****
>>>>> Google uses this solution too and it seems, that this solution is
>>>>> pretty close to the current proposal of OpenId Connect.****
>>>>> Does that mean, that OpenId Connect shows, how to mis-use OAuth2 for
>>>>> Authorization the right way?****
>>>>> ** **
>>>>> Sort of ironic, but yes. OpenID Connect builds on top of OAuth 2 in
>>>>> such a way as to maintain the security of using it for an authentication
>>>>> protocol. ****
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "DotNetOpenAuth" group.
>>>>> To post to this group, send email to dotnetopenid@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> dotnetopenid+unsubscribe@**googl**egroups.com.
>>>>> For more options, visit this group at http://groups.google.com/**group >>>>> **/dotnetopenid?hl=en<http://groups.google.com/group/dotnetopenid?hl=en>
>>>>> .****
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "DotNetOpenAuth" group.
>>>>> To post to this group, send email to dotnet...@googlegroups.com.
>>>>> To unsubscribe from this group, send email to dotnetopenid...@**
>>>>> googlegroups.**com.
>>>>> For more options, visit this group at http://groups.google.com/**group >>>>> **/dotnetopenid?hl=en<http://groups.google.com/group/dotnetopenid?hl=en>
>>>>> .
>> --
>> --
>> Andrew Arnott
>> "I [may] not agree with what you have to say, but I'll defend to the
>> death your right to say it." - S. G. Tallentyre
> To post to this group, send email to dotnetopenid@googlegroups.com.
> To unsubscribe from this group, send email to
> dotnetopenid+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/dotnetopenid?hl=en.
For anyone using the resource owner password credentials grant with DNOA 4.1, if you pass the accessTokenRequestMessage parameter to the following method you can get the username in the CreateAccessTokenMethod:
string GetUserFromAccessTokenRequest(IAccessTokenRequest accessTokenRequest)
{
if (accessTokenRequest is IAuthorizationDescription)
{
return ((IAuthorizationDescription)accessTokenRequest).User;
}
else if (accessTokenRequest is AccessTokenRequestBase)
{
// Use reflection to get username
Type type = accessTokenRequest.GetType();
foreach (var p in type.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance))
{
if (typeof(IAuthorizationDescription).IsAssignableFrom(p.PropertyType))
return ((IAuthorizationDescription)p.GetValue(accessTokenRequest)).User;
}
}
// Error
return null;
}
It may also work with other grant types however I've not tested it. This is obviously a workaround so use at your own risk!
On Tuesday, October 23, 2012 5:30:36 PM UTC+1, Andrew Arnott wrote:
> Yes, someone else was asking about it on Stackoverflow and I saw it wasn't > there yet.
> --
> Andrew Arnott
> "I [may] not agree with what you have to say, but I'll defend to the death > your right to say it." - S. G. Tallentyre
> On Tue, Oct 23, 2012 at 7:55 AM, lawst <steph...@electrum.co.uk<javascript:>
> > wrote:
>>>> I also require access to the username in the CreateAccessToken method >>>> however I can't find an open ticket - can someone please advise what the >>>> current status of this is?
>>>> thanks
>>>> On Monday, July 30, 2012 12:19:29 AM UTC+1, Andrew Arnott wrote:
>>>>> I guess file a ticket for that one.
>>>>> http://bit.ly/dnoawish >>>>> --
>>>>> Andrew Arnott
>>>>> "I [may] not agree with what you have to say, but I'll defend to the >>>>> death your right to say it." - S. G. Tallentyre
>>>>> On Sun, Jul 29, 2012 at 4:13 PM, Manfred Steyer <manfred...@gmx.net>wrote:
>>>>>> Hi Andrew,****
>>>>>> ** **
>>>>>> >> Perfect. Then yes, setting ExtraData in the access token is the >>>>>> right way to go. ****
>>>>>> ** **
>>>>>> thanks. But that leads to the original question – How to get access >>>>>> to the user-name within CreateAccessToken?****
>>>>>> ** **
>>>>>> Wishes,****
>>>>>> Fred****
>>>>>> ** **
>>>>>> *Von:* dotnet...@googlegroups.com [mailto:dotnet...@**googlegroups**
>>>>>> .com] *Im Auftrag von *Andrew Arnott
>>>>>> *Gesendet:* Montag, 30. Juli 2012 00:32
>>>>>> *An:* dotnet...@googlegroups.com
>>>>>> *Betreff:* Re: [dotnetopenauth] How to get user-name in >>>>>> CreateAccessToken****
>>>>>> ** **
>>>>>> On Sat, Jul 28, 2012 at 10:41 AM, Fred <manfred...@gmx.net> wrote:***
>>>>>> *
>>>>>> Hi Andrew,****
>>>>>> thanks for your reply. The extra-data is for the ressource-server. >>>>>> For instance, the token could get the scope http://whatever/moviesand the extra-data-entry: age=14. This could tell the ressource-server to >>>>>> just display a specific sub-set of the movies.****
>>>>>> ** **
>>>>>> Perfect. Then yes, setting ExtraData in the access token is the >>>>>> right way to go. ****
>>>>>> ****
>>>>>> ****
>>>>>> >> Alternatively, the not-recommmended way to do this with OAuth 2 >>>>>> (ala Facebook) is to return the ****
>>>>>> >> username that authorized the access token from the *resource >>>>>> server [...]*****
>>>>>> ****
>>>>>> Google uses this solution too and it seems, that this solution is >>>>>> pretty close to the current proposal of OpenId Connect.****
>>>>>> Does that mean, that OpenId Connect shows, how to mis-use OAuth2 for >>>>>> Authorization the right way?****
>>>>>> ** **
>>>>>> Sort of ironic, but yes. OpenID Connect builds on top of OAuth 2 in >>>>>> such a way as to maintain the security of using it for an authentication >>>>>> protocol. ****
>>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "DotNetOpenAuth" group.
>>>>>> To post to this group, send email to dotnetopenid@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to >>>>>> dotnetopenid+unsubscribe@**googl**egroups.com.
>>>>>> For more options, visit this group at http://groups.google.com/** >>>>>> group**/dotnetopenid?hl=en<http://groups.google.com/group/dotnetopenid?hl=en>
>>>>>> .****
>>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "DotNetOpenAuth" group.
>>>>>> To post to this group, send email to dotnet...@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to dotnetopenid...@**
>>>>>> googlegroups.**com.
>>>>>> For more options, visit this group at http://groups.google.com/** >>>>>> group**/dotnetopenid?hl=en<http://groups.google.com/group/dotnetopenid?hl=en>
>>>>>> .
>>> -- >>> --
>>> Andrew Arnott
>>> "I [may] not agree with what you have to say, but I'll defend to the >>> death your right to say it." - S. G. Tallentyre
>> To post to this group, send email to dotnet...@googlegroups.com<javascript:>
>> .
>> To unsubscribe from this group, send email to >> dotnetopenid...@googlegroups.com <javascript:>.
>> For more options, visit this group at >> http://groups.google.com/group/dotnetopenid?hl=en.