We are generating JWT using Generate JWT policy for integrating with Okta. In okta, app has been set up using public/private key method. Private key we are storing in KVM.
We do not want to store private key in apigee(due to security restrictions raised by some team). Hence, we are generation public key using ‘GetPublicKey’ serivce of AWS. This public key is then stored in okta.
Now, using sign and verify service of AWS, we are getting signature for a message and using concept of JWT Serialization we are generating JWT token. This JWT token is then passed to /token endpoint of okta with SC policy using below parameters(client_assertion will have base64encode )
<Set>
<Path>{servicecallout.request.path}</Path>
<Headers>
<Header name="Content-Type">application/x-www-form-urlencoded</Header>
</Headers>
<FormParams>
<FormParam name="client_id">0odefddfsd0KZDi0h8</FormParam>
<FormParam name="grant_type">client_credentials</FormParam>
<FormParam name="scope">okta.users.manage</FormParam>
<FormParam name="client_assertion_type">urn:ietf:params:oauth:client-assertion-type:jwt-bearer</FormParam>
<FormParam name="client_assertion">lYvdXYftA45liWd7cMNSWkFlmX0dNZwrDlXCCm2Q64H0Lxz3rYslXKDH8bpGjTck3yMsIj/mZ5hf/qMMCVnKqPo7C10Hs6UksniA63QvTKrpx9RaQqSN3jd/ylGRtJqddL0h0iP9X5YxAXbLeGvGNCmxD4Fe5alTD7TfSbOBk/0Kz1MFIyq6t+f4WAVkXEpcFcpPmf3vwW+WfrKe+CnqBcu8VodrD0r6BaXyfT/eRnSBwgf7HCIqDMWEczk34P5uDB6bvRLoxLaj6s0/J7PKFh/vFpzNMkcK7001jMVyUhBsIbduIKSr9mDuih65vz9W3DEEN0qZjzwMrjQ==</FormParam>
</FormParams>
</Set>
Is this the correct way to get JWT token from AWS and then use it to get access_token from okta?