0

I need to validate the oauth Signature which generated by 0-legged oauth 1.0 standards. All oauth parameters ( oauth_signature, ouath_timestamp ,oauth_nonce, oauth_consumer_key, oauth_signature_method, oauth_version ) are coming in the Request DTO ( Request Body ).

@Getter
public class RequestDTO {
    @NotBlank(message = "'oauth_consumer_key' Can not be empty or null")
    private final String oauthConsumerKey;

    @NotBlank(message = "'oauth_signature_method' Can not be empty or null")
    private final String oauthSignatureMethod;

    @NotNull(message = "'oauth_timestamp' Can not be null")
    private final long oauthTimeStamp;

    @NotBlank(message = "'oauth_nonce' Can not be empty or null")
    private final String oauthNonce;

    @NotBlank(message = "'oauth_signature' Can not be empty or null")
    private final String oauthSignature;

    @NotBlank(message = "'oauth_version' Can not be empty or null")
    private final String oauthVersion;

    @NotBlank(message = "'lti_message_type' Can not be empty or null")
    private final String ltiMessageType;

In my application use the spring boot 2.6.7 version. And Just want to validate only one specific endpoint.

    @PostMapping(path = "/oauth", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})
    public ResponseEntity<Void> oauth(
            @Validated RequestDTO requestDTO){

        final String url = myService.method(requestDTO);
        return ResponseEntity.status(HttpStatus.FOUND).location(URI.create(url)).build();
    }

I need to validate the oauth_signature coming in the request dto using spring-secutiry, net.oauth.core outh , oauth-provider libraries or any other library which supports with spring boot 2.6.7 version.

I used and tried with spring security dependency and net.oauth.core outh , oauth-provider dependencies but couldn't find a most suitable solution to validate all ouath params with Springboot 2.6.7 version . I am new to Spring boot and Appreciate all support to solve this

cc gogo
  • 21
  • 1
  • 4

0 Answers0