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

Is it possible to use Authn as a library in any Go project? #179

Closed
frederikhors opened this issue Jul 6, 2021 · 4 comments
Closed

Is it possible to use Authn as a library in any Go project? #179

frederikhors opened this issue Jul 6, 2021 · 4 comments

Comments

@frederikhors
Copy link

It would be amazing to use Authn as a library in any Go project (like does https://github.com/volatiletech/authboss), without the need to call another service on each API call.

Is this already possible?

@cainlevy
Copy link
Member

cainlevy commented Jul 6, 2021

Hi @frederikhors,

without the need to call another service on each API call.

When you use one of the backend integration libraries, your application will automatically cache the public keys necessary to validate a token. They will only need one API call an hour, maybe, as keys rotate.

It may be possible to run AuthN as a library, but I'm not sure what would distinguish AuthN vs any other in-process solution. The process isolation is the main benefit.

@cainlevy cainlevy closed this as completed Jul 6, 2021
@frederikhors
Copy link
Author

It may be possible to run AuthN as a library

How? Is there any docs?

I'm not sure what would distinguish AuthN vs any other in-process solution

There are no good in-process libraries for Go.

@cainlevy
Copy link
Member

cainlevy commented Jul 7, 2021

Wow, I didn't realize that. What's your take on the Authboss library you linked originally?

There aren't any docs for using AuthN as a library, and I haven't thought through the scenario enough to write them on the spot. However, I think you'll find the code is organized in a way that lets you reference the internals using standard Go import paths. You might look at importing the routing table, or the services used to implement business logic for HTTP handlers.

Note that this would be a DIY path. I don't plan to officially support it, because the tradeoff in the security model doesn't appear to be worth optimizing away the API traffic that exists.

@frederikhors
Copy link
Author

What's your take on the Authboss library you linked originally?

Problems, like this.

I don't plan to officially support it

Ok. Thanks.

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