Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEasier local debugging for OAuth2 providers #1988
Comments
|
You should already be able to overwrite {
"authentication": {
"oauth": {
"redirect": "/frontend",
"defaults": {
"host": "localhost",
"protocol": "https"
},
"google": {
"key": "...",
"secret": "...",
"custom_params": { "access_type": "offline" }
},
"twitter": {
"key": "...",
"secret": "..."
}
}
}
} |
|
I tried that but is not just the protocol, is also that is not using the same port. For instance I run a server locally that has a different config (it will connect to a remote database) so is not my development environment but my "local-remote" environment. That will create an OAuth callback link like this: Maybe, to avoid potencial security issues (ensuring https, etc.), the appropriate solution would be to change this line: From: That way any |
The problem
When doing local tests in order to try/test external OAuth2 service providers, it gets really hard to work with localhost on NODE_ENV that are not 'development' or 'test'.
It would be very simple and a big deal for local testing to instead of forcing http/https and port number based on the environment name, to be able to set it in the config file.
The code:
feathers/packages/authentication-oauth/src/index.ts
Lines 34 to 42 in 3215714
What could be done:
Replace:
let protocol = 'https';With:
let protocol = get('protocol') || 'https';And remove: