JWS Class
Contains methods that apply a digital signature to a JSON Web Token (JWT), using a JSON Web Signature (JWS) data structure. This class creates the signed JWT bearer token, which can be used to request an OAuth access token in the OAuth 2.0 JWT bearer token flow.
Use the methods in this class to sign the JWT bearer token with the X509 certificate.
The following are constructors for JWS.
-
Creates an instance of the
JWSclass using the specifiedAuth.JWTpayload and the certificate used for signing the JWT bearer token. -
Creates an instance of the
JWSclass using the specified payload and certificate used for signing the JWT bearer token.
Creates an instance of the JWS class using the specified Auth.JWT payload and the certificate used for signing the JWT bearer token.
public JWS(Auth.JWT jwt, String certDevName)
-
jwt:
Type: Auth.JWT
The Base64-encoded JSON Claims Set in the JWT bearer token generated by
Auth.JWT. -
certDevName:
Type: String
The
Unique Namefor a certificate stored in the Salesforce org’s Certificate and Key Management page to use for signing the JWT bearer token.
Calls the toJSONString() method in Auth.JWT and sets the resulting string as the payload of the JWT bearer token. Alternatively, you can specify the payload directly using JWS(payload, certDevName).
Creates an instance of the JWS class using the specified payload and certificate used for signing the JWT bearer token.
public JWS(String payload, String certDevName)
-
payload:
Type: String
The Base64-encoded JSON Claims Set in the JWT bearer token.
-
certDevName:
Type: String
The
Unique Namefor a certificate stored in the Salesforce org’s Certificate and Key Management page to use for signing the JWT bearer token.
Sets the payload string as the payload of the JWT bearer token. Alternatively, if you generate the payload using Auth.JWT, you can use JWS(jwt, certDevName) instead.
The following are methods for JWS. All are instance methods.
-
Makes a duplicate copy of the JWS object.
-
Returns the compact serialization representation of the JWS as a concatenated string, with the encoded JWS header, encoded JWS payload, and encoded JWS signature strings separated by period (’.’) characters.
Makes a duplicate copy of the JWS object.
public Object clone()
Type: JWS
Returns the compact serialization representation of the JWS as a concatenated string, with the encoded JWS header, encoded JWS payload, and encoded JWS signature strings separated by period (’.’) characters.
public String getCompactSerialization()
Type: String