Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

OAuth2 Client Credentials Requests #33

Closed
gstoyanov opened this issue May 19, 2011 · 5 comments
Closed

OAuth2 Client Credentials Requests #33

gstoyanov opened this issue May 19, 2011 · 5 comments
Assignees
Milestone

Comments

@gstoyanov
Copy link

Hi,
I'm using the OAuth 2 CTP and so far it looks great - good job!
However, there is one issue I recently encountered. I've implemented my authentication server in a way similar to that of the sample. My authentication endpoint is very simple - it just reads the request and builds an appropriate response using AuthporizationServer.
var tokenRequest = this.authorizationServer.ReadAccessTokenRequest();
var response = this.authorizationServer.PrepareAccessTokenResponse( tokenRequest, ResourceServerEncryptionPublicKey );

This approach has been working great with grant_type=authorization_code. But when I tested it with none (i.e. client credentials) or password (i.e. resource owner username and password) PrepareAccessTokenResponse throws an invalid cast exception. I've taken a look at the code of the method and it seems you cast the request object to ITokenCarryingRequest. However, only the AccessTokenAuthorizationCodeRequest type implements this interface, while the other two do not - AccessTokenClientCredentialsRequest and AccessTokenResourceOwnerPasswordCredentialsRequest.
I wanted to try and change the source code to see if implementing the interface will solve this, but I couldn't find it. Is it available anywhere?

@AArnott
Copy link
Member

AArnott commented May 20, 2011

Thanks for this report. The code is available in the oauth2 branch.

@gstoyanov
Copy link
Author

Thanks, I haven't used github before and didn't notice the branch list. I'll try to modify the code and post here if I succeeded at fixing this. Thanks again :)

@gstoyanov
Copy link
Author

I tried changing the code, but I cannot use the assembly I compiled. When I run the project that is using it I get a FileLoadException stating that "Strong name validation failed". I tried turning on and off signing the assembly and providing different key files, but nothing seems to work. Could you please provide me with some more information on how to build the project? Thanks!

@ghost ghost assigned AArnott Jun 16, 2011
@AArnott
Copy link
Member

AArnott commented Jun 27, 2011

Sorry to take so long to reply... you can download nightly builds of OAuth 2 from here:
http://teamcity.dotnetopenauth.net/viewType.html?buildTypeId=bt3&tab=buildTypeStatusDiv

@gstoyanov
Copy link
Author

It's alright, thanks!
We had to roll our own implementation for our scenario, but we may return to DotNetOpenAuth once it is released. It's a great project!
Regards,
Georgi

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants