Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide detailed tutorial #2

Open
nikolalukovic opened this issue Dec 10, 2016 · 3 comments
Open

Provide detailed tutorial #2

nikolalukovic opened this issue Dec 10, 2016 · 3 comments

Comments

@nikolalukovic
Copy link

It would be really nice if you can provide a detailed tutorial from start to finish. Where you begin with a new project; go through installing and setting up Nancy with this library for use. It would help a great deal. I'm currently struggling to make this to work, but don't know if there are steps that i missed, or just did them wrong.

@mrstebo
Copy link
Owner

mrstebo commented Dec 10, 2016

Sounds like a good idea. Out of curiosity, what issues are you having?

@nikolalukovic
Copy link
Author

It's better just to zip you the solution.
I've added both TokenEndpointService and AuthorizationEndpointService and put a bunch of breakpoints there, but it seems that when i open /oauth/authorize or any other path from the bootstrapper nothing happens. So i don't know if this works like rest of Nancy where these services are discovered in runtime, or do i need to plug them in somewhere. It's kinda confusing, at least for me. Any help would be greatly appreciated :)
NancyOauth2.zip

@mrstebo
Copy link
Owner

mrstebo commented Dec 11, 2016

If you navigate to the /oauth/authorize route without having a logged in user, then it should return a 401.

image

Take a look at this line. This is so we know what user we are authorizing. From the zipped project you sent, you don't have any kind of user model, but you could just mock a user being logged in by setting Context.CurrentUser to something, just to check if it works.

Also, you'll need an actual Authorization view and return it in the GetAuthorizationView function.

Hope this helps.

I'll write a blog post shortly on how to get things up and running and add a link to this issue 👍

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

No branches or pull requests

2 participants