diff --git a/oauth2/doc.go b/oauth2/doc.go index 5c29f0fbaad..e8c1c26855d 100644 --- a/oauth2/doc.go +++ b/oauth2/doc.go @@ -166,6 +166,9 @@ type swaggeroauth2TokenParameters struct { // in: formData Code string `json:"code"` + // in: formData + RefreshToken string `json:"refresh_token"` + // in: formData RedirectURI string `json:"redirect_uri"` @@ -180,6 +183,8 @@ type swaggeroauth2TokenResponse struct { TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` RefreshToken string `json:"refresh_token"` + IdToken string `json:"id_token"` + Scope string `json:"scope,omitempty"` } // swagger:parameters flushInactiveOAuth2Tokens diff --git a/sdk/go/hydra/client/public/oauth2_token_parameters.go b/sdk/go/hydra/client/public/oauth2_token_parameters.go index 06c5827c2a1..5950f711632 100644 --- a/sdk/go/hydra/client/public/oauth2_token_parameters.go +++ b/sdk/go/hydra/client/public/oauth2_token_parameters.go @@ -69,6 +69,8 @@ type Oauth2TokenParams struct { GrantType string /*RedirectURI*/ RedirectURI *string + /*RefreshToken*/ + RefreshToken *string timeout time.Duration Context context.Context @@ -152,6 +154,17 @@ func (o *Oauth2TokenParams) SetRedirectURI(redirectURI *string) { o.RedirectURI = redirectURI } +// WithRefreshToken adds the refreshToken to the oauth2 token params +func (o *Oauth2TokenParams) WithRefreshToken(refreshToken *string) *Oauth2TokenParams { + o.SetRefreshToken(refreshToken) + return o +} + +// SetRefreshToken adds the refreshToken to the oauth2 token params +func (o *Oauth2TokenParams) SetRefreshToken(refreshToken *string) { + o.RefreshToken = refreshToken +} + // WriteToRequest writes these params to a swagger request func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -217,6 +230,22 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R } + if o.RefreshToken != nil { + + // form param refresh_token + var frRefreshToken string + if o.RefreshToken != nil { + frRefreshToken = *o.RefreshToken + } + fRefreshToken := frRefreshToken + if fRefreshToken != "" { + if err := r.SetFormParam("refresh_token", fRefreshToken); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/sdk/go/hydra/models/swaggeroauth2_token_response.go b/sdk/go/hydra/models/swaggeroauth2_token_response.go index 02cfca180c8..d34ebf205cb 100644 --- a/sdk/go/hydra/models/swaggeroauth2_token_response.go +++ b/sdk/go/hydra/models/swaggeroauth2_token_response.go @@ -21,9 +21,15 @@ type Swaggeroauth2TokenResponse struct { // expires in ExpiresIn int64 `json:"expires_in,omitempty"` + // Id token + IDToken string `json:"id_token,omitempty"` + // refresh token RefreshToken string `json:"refresh_token,omitempty"` + // scope + Scope string `json:"scope,omitempty"` + // token type TokenType string `json:"token_type,omitempty"` }