Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create authorization server policy with type OAUTH_AUTHORIZATION_POLICY get error #975

Closed
jilds-wex opened this issue Jan 17, 2024 · 3 comments
Assignees
Labels

Comments

@jilds-wex
Copy link

Describe the bug?

When making the call they are generate the body this way:

{ "type": "AuthorizationServerPolicy", "status": "ACTIVE", "name": "Jonathan App12 AuthServer Policy", "description": "Jonathan App12 AuthServer Policy", "priority": 1, "system": false, "conditions": { "clients": { "include": [ "ALL_CLIENTS" ] } } }

What is expected to happen?

Is expected to generate this way, with the right type
{ "type": "OAUTH_AUTHORIZATION_POLICY", "status": "ACTIVE", "name": "Jonathan App12 AuthServer Policy", "description": "Jonathan App12 AuthServer Policy", "priority": 1, "conditions": { "clients": { "include": [ "ALL_CLIENTS" ] } } }

What is the actual behavior?

return the following response because the wrong type:
{ "errorCode" : "E0000003", "errorSummary" : "The request body was not well-formed.", "errorLink" : "E0000003", "errorId" : "oae5ancVR41QveuOA4vfhgwkQ", "errorCauses" : [ ] }

Reproduction Steps?

Try to create a new AuthorizationServerPolicy using the AuthorizationServerApi.createAuthorizationServerPolicy

Additional Information?

The fix can be done in the Policy.java, where the converter for implementation AuthorizationServerPolicy can be done for field type from AuthorizationServerPolicy to OAUTH_AUTHORIZATION_POLICY
image

Java Version

17

SDK Version

14.0.0

OS version

Windows 10

@arvindkrishnakumar-okta
Copy link
Contributor

@jilds-wex Thanks for posting! Will look into this shortly.

@jilds-wex
Copy link
Author

jilds-wex commented Jan 17, 2024

@arvindkrishnakumar-okta, I make some local tests and in the api.yaml file at the definition for Policy, the discriminator is missing this definition that generates the Policy.java correctly:
OAUTH_AUTHORIZATION_POLICY: '#/components/schemas/AuthorizationServerPolicy'

This image is the one that I added to test:
image

@arvindkrishnakumar-okta
Copy link
Contributor

arvindkrishnakumar-okta commented Jan 17, 2024

Will get #976 merged shortly.

Thanks @jilds-wex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants