publicclassSDKConfig {String[] chain; // Supported chain, e.g."ONT","ETH","BSC"String[] alg; // Signature scheme such as "ES256","Ed25519"ServerInfo serverInfo; // Server configuration info, see details belowMap<Integer,VCFilter[]> vcFilters; // VCFilter info for authentication/authorization, see details below}
publicclassServerInfo {String name; // Server nameString icon; // Icon, optionalString url; // Server URL String did; // Server DID, optionalString verificationMethod; // Verification method, optional}
publicclassVCFilter {String type; // Type of VC, e.g. "DegreeCredential"String[] express; // List of expressions for zero-knowledge proofString[] trustRoots // List of trusted VC issuer DIDsboolean required; // If it's required }
Map<string,DidProcessor>
DID processor map
@Override
public String genRandomNonceFunc(Integer action)
Function to generate nonce
@Override
public Integer getActionByNonce(String nonce)
Gets action by nonce
Returns
OntLoginSdk
GenerateChallenge
Generates the challenge.
Parameters
publicclassClientHello {String ver; // Version number String type; // "ClientHello" for this messageint action; // 0: Authentication, 1: AuthorizationClientChallenge clientChallenge; // Challenge sent from the client for mutual authentication, optional}
Returns
ServerHello
publicclassServerHello {String ver; // Version number String type; // "ServerHello" for this messageString nonce; // String of nonceServerInfo server; // Server info String[] chain; // List of supported chainsString[] alg; // List of supported signature schemesVCFilter[] VCFilters; // List of VCFilters, optional ServerProof serverProo // Challenge response sent from the server for mutual authentication, optionalExtension extension; // Extension, optional}
ValidateClientResponse
Validates the response from the client.
Parameters
publicclassClientResponse {String ver; // Version number String type; // "ClientResponse" for this messageString did; // User DIDString nonce; // String of nonce generated by the serverProof proof; // Signature info sent from the client, see details belowString[] VPs; // List of verifiable presentations, optional}