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

Create a new authorization #969

Closed
dail8859 opened this issue Dec 2, 2015 · 15 comments
Closed

Create a new authorization #969

dail8859 opened this issue Dec 2, 2015 · 15 comments

Comments

@dail8859
Copy link

dail8859 commented Dec 2, 2015

I'm needing to create a new authorization using basic authentication (without using the web flow) to create a token. I am not wanting to provide a client id and secret (read: can't provide). The closest thing I could find was AuthorizationsClient.Create() but it requires an id and string.

@haacked
Copy link
Contributor

haacked commented Dec 2, 2015

I don't believe there's any way to do that. Why can't you provide the client id and secret?

@shiftkey
Copy link
Member

shiftkey commented Dec 2, 2015

Authorizations need an application id and secret, so that the user knows the context of why the token was created, and can revoke them at a later date.

@dail8859
Copy link
Author

dail8859 commented Dec 2, 2015

With everything I've read the id and secret need to be kept (not surprisingly) secret, but that's not possible if the code is open source.

Reading the API docs and using curl it's quite easy to create a new authorization without an id or secret, and I was just wanting to be able to do that from the library.

@shiftkey
Copy link
Member

shiftkey commented Dec 2, 2015

With everything I've read the id and secret need to be kept (not surprisingly) secret, but that's not possible if the code is open source.

Totally agree, but there's many ways to do this - for example, we use environment variables we manage the credentials for the integration test suite:

https://github.com/octokit/octokit.net/blob/master/Octokit.Tests.Integration/Helper.cs

@dail8859
Copy link
Author

dail8859 commented Dec 2, 2015

So...then anyone wanting to develop the code would have to create their own id and secret just to build it?

@shiftkey
Copy link
Member

shiftkey commented Dec 2, 2015

@dail8859 correct

@dail8859
Copy link
Author

dail8859 commented Dec 2, 2015

Hmm OK. Sounds like a pain. Thanks for the info though.

@dail8859 dail8859 closed this as completed Dec 2, 2015
@dail8859
Copy link
Author

dail8859 commented Dec 4, 2015

Not sure why I closed this, would still like to see the aforementioned API implemented eventually :)

@dail8859 dail8859 reopened this Dec 4, 2015
@haacked
Copy link
Contributor

haacked commented Dec 4, 2015

Not sure why I closed this, would still like to see the aforementioned API implemented eventually :)

Unfortunately, this is not the repository to log that request. I think an API that doesn't require those things and doesn't use the Web Flow would have major security concerns. You could email [email protected] to make such a request and provide more context on what goals you're trying to accomplish.

@haacked haacked closed this as completed Dec 4, 2015
@dail8859
Copy link
Author

dail8859 commented Dec 4, 2015

Just to clarify, I'm not requesting any changes to the web API, only for the library to support that API call to create a personal access token.

It's how the (previously supported) Github android app did it.

@haacked
Copy link
Contributor

haacked commented Dec 4, 2015

only for the library to support that API call to create a personal access token.

Hmm, I'm confused. Do you want the library to support the web flow? If the web API doesn't have an endpoint for us to create an authorization token without the client secret, how would we implement that in the client library.

@dail8859
Copy link
Author

dail8859 commented Dec 4, 2015

I apologize, it is very possible I'm just using some wrong terminology, so here's an example.

Referencing this document, and using curl, you can see I can create a new personal access token.

test

Was just wanting to be able to do that with Octokit.net

@haacked haacked reopened this Dec 4, 2015
@haacked
Copy link
Contributor

haacked commented Dec 4, 2015

Ah! Got it. Want to submit a pull request implementing that change? I think we just need to add an overload to AuthorizationsClient.

@dail8859
Copy link
Author

dail8859 commented Dec 4, 2015

I'll have to pass :)

@hnrkndrssn
Copy link
Contributor

I can take this if no one else has started it

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

4 participants