dream-num / dream-num/usip-example

Is there a credential websocket example? I encountered authentication failure using usip service

Open
#2 2 comments 0 reactions 1 assignee Claimed by @yangluoshen View on GitHub
Dominant language
Go
Stars
2
Forks
2
PR merge metrics
No merged PRs in 30d

Description

- 1. This is my USIP setup.
```
# usip about
USIP_ENBALED=true
USIP_URI_CREDENTIAL=http://host.docker.internal:8080/credential
USIP_URI_USERINFO=http://host.docker.internal:8080/userinfo
USIP_URI_ROLE=http://host.docker.internal:8080/role
USIP_URI_COLLABORATORS=http://host.docker.internal:8080/collaborators
```
- 2. Then python-usip was used and the following error occurred
```
INFO: 127.0.0.1:57956 - "GET /credential HTTP/1.1" 200 OK
INFO: ('127.0.0.1', 57961) - "WebSocket /credential" 403
INFO: connection rejected (403 Forbidden)
INFO: connection closed
```
- 3. To address the above error, I added the route `@app.websocket("/credential")`
```
@app.websocket("/credential")
async def websocket_endpoint(websocket: WebSocket):
await websocket.accept()
await websocket.send_text("{}")
```

- 4. But something went wrong with the universer container.
```
caller=[/home/runner/work/universer/universer/internal/biz/usip.go:291] service.id=bea0152ad487 service.name=Universer service.version=v0.2.14 trace.id= span.id= user.id= feature.id= msg=[CredentialVerify] json.NewDecoder.Decode err: invalid character 'Á' looking for beginning of value
```

Whether using `websocket.send_text, websocket.send_json`, etc., the above error will occur. How do I handle the authentication of this `websocket`?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.