Skip to content

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

@wssnail

Description

@wssnail
    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
    1. 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
    1. 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("{}")
    1. 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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions