Class OAuthFlows

java.lang.Object
org.apache.juneau.bean.openapi3.OpenApiElement
org.apache.juneau.bean.openapi3.OAuthFlows

public class OAuthFlows extends OpenApiElement
Allows configuration of the supported OAuth Flows.

The OAuthFlows Object allows configuration of the supported OAuth Flows. This object contains the configuration for different OAuth 2.0 flows that can be used to secure the API. Each flow type has its own specific configuration requirements and use cases.

OpenAPI Specification:

The OAuthFlows Object is composed of the following fields:

  • implicit (OAuthFlow) - Configuration for the OAuth Implicit flow
  • password (OAuthFlow) - Configuration for the OAuth Resource Owner Password flow
  • clientCredentials (OAuthFlow) - Configuration for the OAuth Client Credentials flow
  • authorizationCode (OAuthFlow) - Configuration for the OAuth Authorization Code flow
Example:

// Construct using SwaggerBuilder. OAuthFlows x = oauthFlows() .setAuthorizationCode(oauthFlow() .setAuthorizationUrl("https://example.com/oauth/authorize") .setTokenUrl("https://example.com/oauth/token")); // Serialize using JsonSerializer. String json = Json.from(x); // Or just use toString() which does the same as above. json = x.toString();

// Output { "authorizationCode": { "authorizationUrl": "https://example.com/oauth/authorize", "tokenUrl": "https://example.com/oauth/token" } }

See Also:
  • Constructor Details

    • OAuthFlows

      public OAuthFlows()
      Default constructor.
    • OAuthFlows

      public OAuthFlows(OAuthFlows copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The object to copy.
  • Method Details

    • copy

      public OAuthFlows copy()
      Make a deep copy of this object.
      Returns:
      A deep copy of this object.
    • strict

      protected OAuthFlows strict()
      Description copied from class: OpenApiElement
      Sets strict mode on this bean.
      Overrides:
      strict in class OpenApiElement
      Returns:
      This object
    • strict

      public OAuthFlows strict(Object value)
      Description copied from class: OpenApiElement
      Sets strict mode on this bean.
      Overrides:
      strict in class OpenApiElement
      Parameters:
      value - The new value for this property.
      Non-boolean values will be converted to boolean using Boolean.valueOf(value.toString()).
      Can be null (interpreted as false).
      Returns:
      This object
    • getImplicit

      Bean property getter: implicit.

      Describes the type of items in the array.

      Returns:
      The property value, or null if it is not set.
    • setImplicit

      Bean property setter: items.

      Describes the type of items in the array.

      Parameters:
      value - The new value for this property.
      Property value is required if type is "array".
      Can be null to unset the property.
      Returns:
      This object
    • getPassword

      Bean property getter: password.

      Describes the type of items in the array.

      Returns:
      The property value, or null if it is not set.
    • setPassword

      Bean property setter: items.

      Describes the type of items in the array.

      Parameters:
      value - The new value for this property.
      Property value is required if type is "array".
      Can be null to unset the property.
      Returns:
      This object
    • getClientCredentials

      Bean property getter: clientCredentials.

      Describes the type of items in the array.

      Returns:
      The property value, or null if it is not set.
    • setClientCredentials

      Bean property setter: items.

      Describes the type of items in the array.

      Parameters:
      value - The new value for this property.
      Property value is required if type is "array".
      Can be null to unset the property.
      Returns:
      This object
    • getAuthorizationCode

      Bean property getter: authorizationCode.

      Describes the type of items in the array.

      Returns:
      The property value, or null if it is not set.
    • setAuthorizationCode

      Bean property setter: authorizationCode.

      Describes the type of items in the array.

      Parameters:
      value - The new value for this property.
      Property value is required if type is "array".
      Can be null to unset the property.
      Returns:
      This object
    • get

      public <T> T get(String property, Class<T> type)
      Description copied from class: OpenApiElement
      Generic property getter.

      Can be used to retrieve non-standard Swagger fields such as "$ref".

      Overrides:
      get in class OpenApiElement
      Type Parameters:
      T - The datatype to cast the value to.
      Parameters:
      property - The property name to retrieve.
      type - The datatype to cast the value to.
      Returns:
      The property value, or null if the property does not exist or is not set.
    • set

      public OAuthFlows set(String property, Object value)
      Description copied from class: OpenApiElement
      Generic property setter.

      Can be used to set non-standard Swagger fields such as "$ref".

      Overrides:
      set in class OpenApiElement
      Parameters:
      property - The property name to set. Must not be null.
      value - The new value for the property.
      Returns:
      This object
    • keySet

      public Set<String> keySet()
      Description copied from class: OpenApiElement
      Returns all the keys on this element.
      Overrides:
      keySet in class OpenApiElement
      Returns:
      All the keys on this element.
      Never null.