Skip to content

Error parsing Oauth properties in cncf spec using java sdk #357

Closed
@ricardozanini

Description

@ricardozanini

Discussed in serverlessworkflow/specification#857

Originally posted by mahith2108 May 23, 2024
Hi,
we are using Java sdk version "4.0.5.Final" and spec version: 0.8 as suggested (https://github.com/serverlessworkflow/sdk-java)

I am trying to define Oauth properties using "auth" field in my spec as follows based on serverlessworkflow/specification#675

 "auth":[
            { "name" : "serviceCloud",
            "scheme": "oauth2",
            "properties":{
               "scopes": ["$$$$XXXMMMMM"],
               "audiences":["%%%XXXXXXX"] 
            }
            
        }]

while parsing the spec using Workflow.fromSource("") I am getting following error.

Could not convert markup to Workflow: Unrecognized field "scopes" (class io.serverlessworkflow.api.auth.BasicAuthDefinition), not marked as ignorable (3 known properties: "password", "username", "metadata"])
 at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.serverlessworkflow.api.Workflow["auth"]->io.serverlessworkflow.api.auth.BasicAuthDefinition["scopes"])

we have tried following spec as well but the authDefinition.getOauth() is coming as null.

 "auth":[
            { "name" : "serviceCloud",
            "scheme": "oauth2",
            "oauth":{
               "scopes": ["%%%%%X"],
               "audiences":["%%%XXXXXX"] 
            }
        }]
@JsonPropertyOrder({"name", "scheme", "basicauth", "bearerauth", "oauth"})
public class AuthDefinition implements Serializable {

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions