Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when revoking token via RevokeOAuth2Token method #22

Open
3 of 5 tasks
patzj opened this issue Mar 4, 2024 · 0 comments
Open
3 of 5 tasks

Error when revoking token via RevokeOAuth2Token method #22

patzj opened this issue Mar 4, 2024 · 0 comments
Labels
bug Something is not working.

Comments

@patzj
Copy link

patzj commented Mar 4, 2024

Preflight checklist

Ory Network Project

No response

Describe the bug

When I'm using the SDK to revoke a token, I'm getting .

Reproducing the bug

  1. Create an Echo endpoint to revoke a token:
func RevokeTokenHandler(c echo.Context) error {
        // ... code snippet

	_, err := apiClient.OAuth2API.
		RevokeOAuth2Token(requestCtx).
		ClientSecret(payload.ClientSecret).
		ClientId(payload.ClientId).
		Token(payload.Token).
		Execute()

	if err != nil {
		fmt.Println(err.Error())
		return err
	}

	return nil
}
  1. Send POST request to the endpoint with JSON data:
{
	"clientId": "<reducted>",
	"clientSecret": "<reducted>",
	"token": "ory_at_<reducted>"
}

Relevant log output

{"time":"2024-03-04T15:49:36.170649869+08:00","id":"","remote_ip":"::1","host":"localhost:8080","method":"POST","uri":"/au/auth/token/revoke","user_agent":"insomnia/2023.5.8","status":500,"error":"json: cannot unmarshal object into Go struct field _ErrorOAuth2.error of type string","latency":2573077,"latency_human":"2.573077ms","bytes_in":211,"bytes_out":36}

Relevant configuration

services:
  hydra:
    image: oryd/hydra:v2.2.0
    container_name: hydra
    ports:
      - 5444:4444
      - 5445:4445
      - 5555:5555
    environment:
      - SECRETS_SYSTEM=grantwardishydra
      - URLS_SELF_ISSUER=http://localhost:4444
      - URLS_LOGIN=http://localhost:9020/login
      - URLS_LOGOUT=http://localhost:9020/logout
      - URLS_CONSENT=http://localhost:9020/consent
      - DSN=postgres://hydra:secret@postgres:5432/hydra?sslmode=disable
    command: serve all --dev
    restart: unless-stopped
    depends_on:
      - postgres
      - hydra-migrate
    networks:
      - backend

  hydra-migrate:
    image: oryd/hydra:v2.2.0
    container_name: hydra-migrate
    environment:
      - DSN=postgres://hydra:secret@postgres:5432/hydra?sslmode=disable
    command: migrate sql -e --yes
    restart: on-failure
    depends_on:
      - postgres
    networks:
      - backend

  hydra-consent:
    image: oryd/hydra-login-consent-node:v2.2.0
    container_name: hydra-consent
    ports:
      - 9020:3000
    environment:
      - HYDRA_ADMIN_URL=http://hydra:4445
    restart: unless-stopped
    networks:
      - backend

  postgres:
    image: postgres
    container_name: hydra-db
    restart: always
    ports:
      - 5432:5432
    environment:
      - POSTGRES_DB=hydra
      - POSTGRES_USER=hydra
      - POSTGRES_PASSWORD=secret
    networks:
      - backend

networks:
  backend:
    name: hydra-net

Version

v2.2.0

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Docker

Additional Context

No response

@patzj patzj added the bug Something is not working. label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

1 participant