Repository: zitadel/oidc (go)

Issue:
Support ``verification_url`` mispelling in the device auth response
### Preflight Checklist

- [X] I could not find a solution in the existing issues, docs, nor discussions
- [ ] I have joined the [ZITADEL chat](https://zitadel.com/chat)

### Describe your problem

Hello, any chance that this lib would implement this kind of workaround implemented by golang/oauth2: 
https://github.com/golang/oauth2/blob/master/deviceauth.go#L58-L78
```golang
func (c *DeviceAuthResponse) UnmarshalJSON(data []byte) error {
	type Alias DeviceAuthResponse
	aux := &struct {
		ExpiresIn int64 `json:"expires_in"`
		// workaround misspelling of verification_uri
		VerificationURL string `json:"verification_url"`
		*Alias
	}{
		Alias: (*Alias)(c),
	}
	if err := json.Unmarshal(data, &aux); err != nil {
		return err
	}
	if aux.ExpiresIn != 0 {
		c.Expiry = time.Now().UTC().Add(time.Second * time.Duration(aux.ExpiresIn))
	}
	if c.VerificationURI == "" {
		c.VerificationURI = aux.VerificationURL
	}
	return nil
}
```

I am implementing a client for google API using zitadel/oidc lib but they are using verification_url instead of uri ...
https://stackoverflow.com/q/76696956/5690223
https://developers.google.com/identity/protocols/oauth2/limited-input-device?hl=fr#success-response


### Describe your ideal solution

I have no better solution in head than the workaround described

### Version

3.14.0

### Additional Context

_No response_

Pull request:
feat: support verification_url workaround for DeviceAuthorizationResponse unmarshal
fixes #565 

Patch:
diff --git a/pkg/oidc/device_authorization.go b/pkg/oidc/device_authorization.go
index 68b8efa..a6417ba 100644
--- a/pkg/oidc/device_authorization.go
+++ b/pkg/oidc/device_authorization.go
@@ -1,5 +1,7 @@
 package oidc
 
+import "encoding/json"
+
 // DeviceAuthorizationRequest implements
 // https://www.rfc-editor.org/rfc/rfc8628#section-3.1,
 // 3.1 Device Authorization Request.
@@ -20,6 +22,26 @@ type DeviceAuthorizationResponse struct {
 	Interval                int    `json:"interval,omitempty"`
 }
 
+func (resp *DeviceAuthorizationResponse) UnmarshalJSON(data []byte) error {
+	type Alias DeviceAuthorizationResponse
+	aux := &struct {
+		// workaround misspelling of verification_uri
+		// https://stackoverflow.com/q/76696956/5690223
+		// https://developers.google.com/identity/protocols/oauth2/limited-input-device?hl=fr#success-response
+		VerificationURL string `json:"verification_url"`
+		*Alias
+	}{
+		Alias: (*Alias)(resp),
+	}
+	if err := json.Unmarshal(data, &aux); err != nil {
+		return err
+	}
+	if resp.VerificationURI == "" {
+		resp.VerificationURI = aux.VerificationURL
+	}
+	return nil
+}
+
 // DeviceAccessTokenRequest implements
 // https://www.rfc-editor.org/rfc/rfc8628#section-3.4,
 // Device Access Token Request.


Test patch:
diff --git a/pkg/oidc/device_authorization_test.go b/pkg/oidc/device_authorization_test.go
new file mode 100644
index 0000000..c4c6637
--- /dev/null
+++ b/pkg/oidc/device_authorization_test.go
@@ -0,0 +1,30 @@
+package oidc
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestDeviceAuthorizationResponse_UnmarshalJSON(t *testing.T) {
+	jsonStr := `{
+		"device_code": "deviceCode",
+		"user_code": "userCode",
+		"verification_url": "http://example.com/verify",
+		"expires_in": 3600,
+		"interval": 5
+	}`
+
+	expected := &DeviceAuthorizationResponse{
+		DeviceCode:      "deviceCode",
+		UserCode:        "userCode",
+		VerificationURI: "http://example.com/verify",
+		ExpiresIn:       3600,
+		Interval:        5,
+	}
+
+	var resp DeviceAuthorizationResponse
+	err := resp.UnmarshalJSON([]byte(jsonStr))
+	assert.NoError(t, err)
+	assert.Equal(t, expected, &resp)
+}