hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Can't import admin package in Golang project

Open orestevip opened this issue 3 years ago • 2 comments

Preflight checklist

Describe the bug

Hi,

I'm following an online tutorial on how to implement Ory/Hydra over Golang project. Right now, I want NewGetLoginRequestParams method from the following package https://pkg.go.dev/github.com/ory/hydra-client-go/client/admin but github.com/ory/hydra-client-go/client/admin returns 404.

I need to access the admin API to accept the login request but it is marked as "internal" inside Hydra package and I can't access it. How am I supposed to accept a login challenge? Am I wrong about anything?

Thanks in advance, Oreste

Reproducing the bug

Set up a Golang project with Ory/Hydra and try to accept a login request importing github.com/ory/hydra-client-go/client/admin (404) or github.com/ory/hydra/tree/master/internal/httpclient/client (internal)

Relevant log output

go get github.com/ory/hydra-client-go/client/admin    
go: module github.com/ory/hydra-client-go@upgrade found (v1.11.8), but does not contain package github.com/ory/hydra-client-go/client/admin

Relevant configuration

No response

Version

1.11.10

On which operating system are you observing this issue?

Windows

In which environment are you deploying?

Binary

Additional Context

No response

orestevip avatar Sep 02 '22 13:09 orestevip

What tutorial are you using? It seems to be outdated

aeneasr avatar Sep 08 '22 19:09 aeneasr

What tutorial are you using? It seems to be outdated

Hi aeneasr, I've used the following link. I'm getting into Hydra but I'm still having some troubles with it (my bad for sure ;) ). Would you please link me a valid admin package for Golang (if any exists)?

Thanks, Oreste

orestevip avatar Sep 14 '22 14:09 orestevip

I would like to know, is the openapi client the only way to access the admin interface from the go client? I haven't found any other way (except for calling the endpoint directly). The admin interface has been moved to the internal directory, and it's not anymore accessible from the go client.

alfmos avatar Oct 04 '22 07:10 alfmos

Thanks, that tutorial is not written by us. We try to keep our content up to date always. You can still use the older version of the SDK if you want to just get it working, but starting with Ory Hydra 2.0 the old SDK is deprecated!

aeneasr avatar Oct 04 '22 10:10 aeneasr

Sorry @aeneasr, I haven't understood. Which is the right way to call hydra admin from hydra-client-go? Openapi client? Thanks

alfmos avatar Oct 04 '22 12:10 alfmos