Getting state and nonce on SpringBoot application

Hi,
I need to create an \authorize URL from our Spring Boot application and send it to Okta .
Design given to be followed - https://OktaTenantDomain.oktapreview.com/oauth2/default/v1/authorize?client_id=***************&response_type=code&scope=openid profile email&redirect_uri=NewSpringBootEndpointWhereTokenWillBeSent&state=UseALibraryToCreateState&response_mode=fragment&nonce=UseALibraryToCreateNonce

Can someone please help and let me know how to get the state and nonce on Spring Boot application?

Thanks in advance for any help.