pünktchen 704 Posted November 25, 2019 Share Posted November 25, 2019 Is there an interface or method to create an api key from within a NetCore plugin? Link to post Share on other sites
chef 1849 Posted November 25, 2019 Share Posted November 25, 2019 In the SessionService there is an authKeys endpoint. This might be something. You can POST it GET. Link to post Share on other sites
chef 1849 Posted November 25, 2019 Share Posted November 25, 2019 Yes so it is the AuthKeys endpoint in sessionService. You can create an app with POST. Then use GET, to get the apps API Key that is auto generated Link to post Share on other sites
pünktchen 704 Posted November 25, 2019 Author Share Posted November 25, 2019 Thanks, but my question is if it's possible without the json api. Just pure C# Link to post Share on other sites
chef 1849 Posted November 25, 2019 Share Posted November 25, 2019 (edited) I don't see one you're right. IHttpClient using (await HttpClient.Post( new HttpRequestOptions { Url = "/Auth/Keys?App=" + app.Name, CancellationToken = CancellationToken.None, EnableHttpCompression = false, }) .ConfigureAwait(false)) { Does that work? Edited November 25, 2019 by chef Link to post Share on other sites
pünktchen 704 Posted November 25, 2019 Author Share Posted November 25, 2019 Mmh, but to send this post request i already have to authenticate myself with an API key or not? Link to post Share on other sites
chef 1849 Posted November 25, 2019 Share Posted November 25, 2019 not inside a plugin you don't Link to post Share on other sites
pünktchen 704 Posted November 25, 2019 Author Share Posted November 25, 2019 Wow, didn't know that. So i asume that it also was no mistake by you that you didn't provide a host and port in the request? Link to post Share on other sites
chef 1849 Posted November 25, 2019 Share Posted November 25, 2019 (edited) Wow, didn't know that. So i asume that it also was no mistake by you that you didn't provide a host and port in the request? Well thats the thing I'm not sure about. It would have to be tested. The ApiClient object would already be authenticated. I'm pretty sure. EDIT: upon further inspection... I might not be correct. Edited November 25, 2019 by chef Link to post Share on other sites
pünktchen 704 Posted November 25, 2019 Author Share Posted November 25, 2019 Okay, maybe some insights from @@Luke can help here. Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now