shaj13 / go-guardian

Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to create powerful modern API and web authentication.
MIT License
543 stars 55 forks source link

organize basic and token examples #104

Closed shaj13 closed 3 years ago

shaj13 commented 3 years ago

What did you expect to see?

token and basic example

What did you see instead?

https://github.com/shaj13/go-guardian/tree/master/_examples/basic_bearer

TODO

split the basic_bearer to basic and token. the token example can use the basic similar to jwt example

briwagner commented 3 years ago

I took a shot at making a PR for this. I don't see it linked here, so maybe I missed something.

The basic example seemed pretty straight-forward.

Two things on the token example:

  1. I added the auth.RequestWithUser() piece which I saw on another example. Seems to fit here.
  2. I wondered about the curl example on line 27, using basic auth to access the record. I'm not sure if that is a bit outside the scope for token example. Seems more complicated to disallow that.

Please let me know if this will work, or anything I can fix. Thanks for the opportunity

shaj13 commented 3 years ago

@briwagner thx, PR merged, FYI, token-based authentication relay on pre-existing user credentials or a static token.

shaj13 commented 3 years ago

FIXED #108