reSolve framwork: How to authenticate a user via HTTP-request (routeRegisterCallback)? - authentication

I am new to web-app development and the reSolve framework I am using for the backend (javascript). Since the application will have multiple users with different authorizations, I am using the Authentication and Authorization module like described in the documentation plus some lines from the shopping-list-advanced example.
The problem I am facing now is, how to make the HTTP-request in order to actually authenticate a user (register/login and also, logout)?
Since I couldn't find anything in the documentation, I've been trying a POST-request to http://localhost:3000/register but it always just returned Access error: POST is not addressable by current executor. What am I missing?
Another problem, or rather unclarity: In the example shopping-list-advanced what is "ROOT_JWT_TOKEN" and what is it used for?
Thanks a lot in advance.

I found it myself - at least the general path for the HTTP-request (see marked comment in picture):
Picture was taken from: https://github.com/reimagined/resolve/tree/master/packages/modules/resolve-module-auth

Related

Trying to get Client ID and Client Secret for Yahoo API but no option to select "Installed Application"

I've been attempting to utilize the Yahoo API to connect to fantasy sports data. I don't have a web URL to connect to when I attempt to create an app, and everything I've read has mentioned that I should select "Installed Application" to avoid using a URL.
This option is not available to me.
Yahoo Developer Screenshot
On the official documentation this is what I see here
Yahoo Developer Documentation
Not sure if it makes a difference but I'm based out of Canada.
Thanks!
It's hard to find the documentation for it, but what you want is called oob (out of bounds, out of band). To get this to work, the steps are a little different (there is no such thing as installed application from what I'm aware of):
Add oob as one of the redirect uris
Make your normal request to the auth/login uri
This will give you a new page that provides you with a token. At this point, you need to manually use this token when you request the /auth/token uri
This last step just replaces the redirect to https://your-redirect.com/token and you will end up in the same position as before.
Now, you still shouldn't put your client_secret in your application if you plan on releasing it, but if you're using it internally or letting others provide their own secret then you should be good.
If you find the original documentation with the PHP source code, you can follow this flow.

Try it out functionality of tmdb api not working

When I tried to see data through try it out functionality then it is showing the following error
Error: Network Error
Check the developer tools console, it might have more information on the error.
If you are using an Adblocker, it is possible your Adblocker is blocking the request.
I also tried after disabling adblocker but it also does not work
console showing like this
Why this is happening and what is the solution for this?
Thanks in advance
Try the url in your browser with the API key. You can see the response.
Example :
https://api.themoviedb.org/3/movie/popular?api_key=your_api_key
Found out this is due to extension 'stoplight' in their site. Site Manager has said
"I believe Stoplight has temporarily blocked the "Try it out" feature for our account because too many people were using it as the source
for their apps, and not using api.themoviedb.org for some reason. No
timeline on getting it restored, but that's the problem. - Travis Bell"
follow this thread, In case it gets sorted in future.
https://www.themoviedb.org/talk/600184fc6aa8e0004077e364?page=1#6001bbacbe4b36003d514ac3
Apparently it depends on the way you try to access the data.
In my React application I was using Axios.Which ended up with ReferenceError: response is not defined. (got no response)
Afterwards I tried using the javascript fetch API. It worked good for me
So if you are trying to use it in an app you might want to use the fetch API. If you just encounter network error while using Try it out function on site - then you can copy the link and paste it directly, it should work fine.
Currently, I am using it in my dashboard and I have JWT authentication for the API that I'm using. I have implemented the interceptor to update HTTP HEADERS so I saw I'm passing a header name 'token' and checked there if any unnecessary headers were given or not with not accepting the TMDB API server. So I have sent a clean HTTP request and it's working fine.
All you have to just remove the unnecessary HTTP HEADERS

Getting 403 Forbidden error when creating onlineMeetings

I tried posting to /app/onlineMeetings but I always get 403 Forbidden error (both on NodeJS and C#) samples. I already set the API permissions on the app registration and on the scope. Is there anything else that I need to setup before this will work on my end?
Any help is appreciated. Thanks!
The API /app/onlinemeetings is beta API that has been deprecated and is replaced by /communications/onlinemeetings. I recommend trying that instead.
I was able to make it work. I didn't realize on the first try that I need to have the application permission level to able to use onlineMeetings endpoint. I was just following their NodeJS tutorial that doesn't cover endpoints that need application permissions.
Your problem probably is when you are going to get the access token for your application. If you are using common as tenant id, first you have to do is use your tenant id instead of common word, as explain here.

How to add remote issue link in jira-rest-api

I've got a program which creates JIRA issues using the jira-rest-api supported by Atlassian.
What I'd like to do is to create a link within the issue to an external URL (actually a presigned Amazon S3 link).
At the REST level this should be doable with a POST request to the Jira api to create a remoteLink. However I cannot find methods in the client APIs or a RemoteLink dto in the Java library.
Nor does the Java library appear to give any access to lower level REST handlers.
Now, I could set up my own REST handling code, going right back to the endpoint URL and authentication, but that's messy, when most of the code the code should already be there. Also I can't clearly see which json fields are required, and which not can be left to the API.
Am I overlooking something obvious in the documentation? I can't even seem to locate source for the client implementation, only the interface layer.
My current code is using version 3.0.6 of the api, but I've just checked v4 (which seems to be the latest on offer) and there's still no RemoteLink support.
Have you tried with these?
Server: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/?_ga=2.26380925.1321063199.1523351418-1788196903.1491202928#api/2/issue-deleteRemoteIssueLinkById
Cloud: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-issue-issueIdOrKey-remotelink-linkId-delete

REST API Works in Browser, But Not Client

I am developing a REST API, and have found a very interesting problem.
When I access the resources in a web browser (in my case Chrome), everything works fine. However, when I access the resources using a REST client (Google Chrome plugin, web-based client, and a Java applet), NONE of the variables pass to the API. This happens both with GET and POST methods.
I have absolutely no idea why this would be the case, and it's proving very difficult to test the methods before putting them into production (especially with POST methods).
Please help!
At first glance it sounds it could be 2 things:
You are not correctly passing API parameters via your client or
applet
A problem with authentication or cookie management. Does the API require any type of authorization?
Are you forgetting to set a necessary HTTP header?
Do you have control of the API also or is it a third party API? If so, do the params arrive at all or do they arrive empty? What's the error code? - a 403 not authorized (which would make sense if the key doesn't pass) or something else due to missing params.
Try the intermediate step of doing it with CURL form the command line - that'll give you more detail on what's coming back.