Comments (2)
I wasn't able to reproduce this for a tunnel-port with anonymous access enabled.
The authorization is received as expected by the server.
You mentioned http://tunnel-address:80/path1/path2
. One change you can try is to remove :80
and use https://tunnel-address/path1/path2
instead.
Here's the steps I used.
Client using node-fetch:
const fetch = require('node-fetch');
const url = 'https://tunnelid-3000.usw2.devtunnels.ms/endpoint';
const authToken = 'your-auth-token';
fetch(url, {
headers: {
Authorization: `Bearer ${authToken}`,
accept: 'application/json'
}
})
.then(response => console.log(response))
.then(data => {
// Handle the response data here
console.log(data);
})
.catch(error => {
// Handle any errors that occurred during the request
console.error(error);
});
Server-side code:
# python3 -m pip install flask
from flask import Flask, request
app = Flask(__name__)
@app.route('/endpoint', methods=['GET'])
def endpoint():
# Get the Authorization header
auth_header = request.headers.get('Authorization')
# Check if the header exists and starts with 'Bearer '
if auth_header and auth_header.startswith('Bearer '):
# Extract the token value
token = auth_header.split(' ')[1]
# Print the token to the console
print("token:", token)
return 'Token received and processed successfully'
else:
return 'Invalid Authorization header', 401
if __name__ == '__main__':
app.run(port=3000)
from dev-tunnels.
Closing as stale.
from dev-tunnels.
Related Issues (20)
- Request more ports per tunnel HOT 1
- command with devtunnel full path will have error HOT 13
- Deserialization error, any command forms the CLI now crash HOT 4
- AADSTS100007 Only managed identities and Microsoft internal service identities are supported. SN+I authentication is required. HOT 2
- Dev tunnels extremely slow all of the sudden HOT 6
- Feature Request: Configure dev tunnels trough config file
- HTTP POST fails with 401 Unauthorized HOT 7
- Add support for GCCH tenants HOT 1
- App occasionally goes to the wrong port
- Why some ports can be accessed with :PORT and others cannot HOT 1
- Bandwidth
- devtunnel user login hangs
- SSH user name is required for a port with SSH protocol.
- Google emulator rediect with url login failing 9/10 times when going trough tunnel
- Skip AntiPhishing page on user click/interaction HOT 5
- Can a request returning a file cause issues? HOT 1
- Force authentication HOT 1
- Closed
- GRPC over dev tunnels HOT 2
- Object reference not set to an instance of an object. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dev-tunnels.