Class RFC7523Utils
- java.lang.Object
-
- org.oa4mp.delegation.server.client.RFC7523Utils
-
- All Implemented Interfaces:
RFC7523Constants
public class RFC7523Utils extends Object implements RFC7523Constants
Created by Jeff Gaynor
on 6/5/23 at 10:02 AM
-
-
Field Summary
-
Fields inherited from interface org.oa4mp.delegation.server.server.RFC7523Constants
ASSERTION, ASSERTION_JWT_BEARER, CILENT_ASSERTION, CILENT_ASSERTION_TYPE, DEFAULT_LIFETIME, GRANT_TYPE_JWT_BEARER
-
-
Constructor Summary
Constructors Constructor Description RFC7523Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static net.sf.json.JSONObject
createBasicJWT(Client client)
Every basic JWT has the same structure.static String
doPost(edu.uiuc.ncsa.security.servlet.ServiceClient serviceClient, Client oa2Client, URI accessTokenEndpoint, String keyID, Map parameters)
Does a POST to the endpoint using the client's key.static String
doTokenRequest(edu.uiuc.ncsa.security.servlet.ServiceClient serviceClient, Client client, URI tokenEndpoint, String kid, Map parameters)
Creates an authorization grant for the client as per RFC 7523 section 2.1.protected static edu.uiuc.ncsa.security.util.jwk.JSONWebKey
findKey(Client client, String kid)
-
-
-
Method Detail
-
doPost
public static String doPost(edu.uiuc.ncsa.security.servlet.ServiceClient serviceClient, Client oa2Client, URI accessTokenEndpoint, String keyID, Map parameters)
Does a POST to the endpoint using the client's key. This fuilfills RFC 7523's section 2.2, authentication using a JWT. This returns a string (a JSON object) since there are various checks that can/should be done on the response, but not necessarily immediately.- Parameters:
serviceClient
-oa2Client
-accessTokenEndpoint
-parameters
-- Returns:
-
createBasicJWT
protected static net.sf.json.JSONObject createBasicJWT(Client client)
Every basic JWT has the same structure. Create it here.- Parameters:
client
-- Returns:
-
findKey
protected static edu.uiuc.ncsa.security.util.jwk.JSONWebKey findKey(Client client, String kid)
-
doTokenRequest
public static String doTokenRequest(edu.uiuc.ncsa.security.servlet.ServiceClient serviceClient, Client client, URI tokenEndpoint, String kid, Map parameters)
Creates an authorization grant for the client as per RFC 7523 section 2.1. Note that clients must have a previous trust relationship to do this, or it will fail.- Parameters:
serviceClient
-client
-parameters
-
-
-