I need help with an oauth2 connection to RocketChat. RocketChat is installed and running on the server but I can't get the oauth2 connection to connect. The error message I get back is: W20191125-03:17:11.951(0) (oauth_server.js:392) Error in OAuth Server: Unexpected end of JSON input I20191125-03:17:13.401(0) Exception while invoking method 'login' { SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at CustomOAuth.getAccessToken (app/custom-oauth/server/custom_oauth_server.js:140:16) at Object.OAuth.registerService.query [as handleOauthRequest] (app/custom-oauth/server/custom_oauth_server.js:189:26) at OAuth._requestHandlers.(anonymous function) (packages/oauth2/oauth2_server.js:10:33) at middleware (packages/oauth/oauth_server.js:161:5) at /opt/rocketchat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40 message: 'Unexpected end of JSON input' } Which is very clear, there was an unexpected end of the JSON input. What I need to know is how can I see what the JSON input was to understand why there was an unexpected end. The people at RocketChat were of no help. I looked at the oauth2 code but I don't have much experience in oauth connections. It is written in php.
Well, you never know where coders may be lurking. Hey, I am a geek but I like burning wood to heat the house.
I've worked in IT (infrastructure ) for >45 yrs. I've used various programming languages. But, what you posted, is total gobbley gook to me. Must not be anything "old school" enough. Sorry, can't help.
Find that guy JSON, and tell him to get back to inputting! Although, I sould not call it "unexpected," he has been slacking off for quite a while. I hope this helps. PS: I used to hobby code in BASIC (yes, I know), C, and Assembly Language, and dabbled with a few others. Haven't done it for a few years, but your title pulled me in.
oauth is a way to securely connect to an application without giving the application your login information. Google log-on is one example, you go to a site and it states you can connect with your google account; that uses oauth.
JSON is Javascript Open Notation. It is a data exchange format. In this case it is User Name, ID, etc that can be passed to the application that will then parse the data. I am rather new to both oauth and JSON; I haven't really used them much. In this application I am trying to connect members of a group; say like on the Firewood Hoarders Club Forum here, to a RocketChat based chat room. You would log into the Firewood Hoarders Club Forum then you would just click on say "Go to chat room." You would not have to log into chat because the oauth connection would do that for you; your user name and avatar would be automatically copied over to the chat room.
Yep, started in BASIC, have done C and Assembly language, FORTRAN when I was in university, PASCAL when in college. Apple killed PASCAL with their license argument. I liked PASCAL; it was OOP and fun to programme. Two weeks before final exams my FORTRAN prof assigned us the task to write a matrix calculator. It was suppose to be able to invert, multiple, divide; the whole works. Two weeks; uh, we need to study for final exams. I got with my friend and we started to work on the code; he was the friend that ended up being murdered by a druggie. Then some student I didn't know wanted to join our team; so OK, I agreed and assigned her to work on the manual. My friend and I were pounding the keyboard like mad trying to get the code written and tested. I took a rest-room break and saw the student sitting outside the computer lab chatting away with her friends. I stopped and asked her why she wasn't working on the manual. She replied, "I am," and showed me some sketches on a page. I didn't say a word and returned to coding. Never saw her again and when we turned in the assignment; incomplete of course, her name was not on the assignment. If she had just made an effort I would have placed her name on the assignment but no, no effort, no credit.
They are killing IT here; Indians with fake degrees are taking over the industry. There is one leftist party that wants to remove the cap completely on foreign workers; I will try to keep the politics low but it is not easy in this day and age. Even the current president raised the cap on H1-B visas. Here is the sad part, the IT people had to train the foreign workers; if they were so great, they wouldn't need training. If they didn't, they wouldn't get the severance package. One candidate in the last Presidential election was correct; although he has changed his tune now. It is a race to the bottom.
Understood. After 17+ yrs at my last job, I was told I was no longer needed. Departments were being outsourced. At 59, there weren't too many companies interested in taking me on. I managed to get a couple of contracting engagements working for a former manager. I remained in contact with work friends. Some still there, others who were also let go. The company doesn't have that great of a future. Oh well. Best of luck getting your issue resolved
Not much REST experience here with me. I believe there are packages to test what is being sent. Don’t know enough to suggest anything particular. I started in C, have to support Fortran, wrote Java almost 2 decades ago (!), support PHP, SAS, Informix 4GL, SQL, ...
It's not just IT, and it's not just people replacing people. More and more jobs are going to machines and technological solutions. This has been going on since the wheel was invented (actually since the start of life, it's called evolution). Prepare yourself by being creative. Quality of life goes up and up for all mankind by spreading education and the means to provide for your loved ones. Regardless of what language you speak or where you were lucky or unlucky enough to be born.
While not trying to create an argument, and this is a family friendly site, so I'll use one word.. Hogwash!! Being creative is great for whatever corporation one is working for, and at some point that creative person will end up training their replacement that will work for a fraction of the pay. Quality of life is not going up for everyone. Further, college education is free in much of the world, allowing for more graduates with little to no debt compared to getting a college degree in the US. The only way a creative individual or small group will truly get ahead is if they work on their own apps/programs independent of corporate influence. This is not easy either, as many employers dictate that they have rights to any IP (Intellectual Property) that the individual comes up with while under employment, whether on the job or off. You are theirs 24/7. Much like the old model of the music industry, anything the band's created was ultimately owned by whatever label "owned" them.
Often more time is spent looking at a phone than having conversations with the people around you. I am happy to say that wasn't the case for most of my family on Thanksgiving Day; we spent time actually enjoying each other's company.
Being creative includes leaving the corporate job and striking out on your own. How do I know? I did exactly that four months ago when I got tired of my creativity being underappreciated by the large corporate machine. So, I think we are in general agreement about that.
I'm glad to hear that you were able to get free. I could never have been able to financially accomplish that back then.
Try to see if the server logs show anything. Such as the user connection, you may need to turn debug on in the logs to see everything going on. Most likely you will. I'm not a programmer but I ran my own fbsd server for a while so I had to figure out errors from time to time. It's also been quite a few years since I stopped running one.