optum / openid-client-server Goto Github PK
View Code? Open in Web Editor NEWAn OpenId Relying Party (RP, Client) application server.
License: Apache License 2.0
An OpenId Relying Party (RP, Client) application server.
License: Apache License 2.0
I work within EFWAE in Optum and was having an issue with the openid-client-server and was referred here by Alex Aavang.
While investigating why our react front end was seeing calls that should be JSON as XML I came across a possible bug within the server. The headers from node-fetch are key value pairs where the value is an array with a single value. The node response header method, res.writeHead expects these headers to be set as strings rather than arrays. This is not the case when performing a getUserInfo request to the OAuth provider but only happens with the response from our koa api.
Adding the following code at the beginning of the sendResponse method in /middleware/util.ts resolves the issue as it converts the arrays into strings. Without these changes none of the headers seen in the response from the koa API are forwarded to the client.
if(headers.raw){ headers = JSON.parse(JSON.stringify(headers.raw())) }
This can also been seen in the network tab of the page using the server. As you can see the response does not have a content-type and is therefore seen as xml.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.