Search in sources :

Example 1 with CreateConsentData

use of com.authlete.jaxrs.server.obb.model.CreateConsentData in project java-oauth-server by authlete.

the class ConsentDao method create.

public Consent create(CreateConsent createConsent, long clientId) {
    CreateConsentData data = createConsent.getData();
    String consentId = generateConsentId();
    String now = ObbUtils.formatNow();
    Consent consent = new Consent().setConsentId(consentId).setPermissions(data.getPermissions()).setStatus("AWAITING_AUTHORISATION").setCreationDateTime(now).setExpirationDateTime(data.getExpirationDateTime()).setStatusUpdateDateTime(now).setClientId(clientId);
    getStore().put(consentId, consent);
    return consent;
}
Also used : CreateConsentData(com.authlete.jaxrs.server.obb.model.CreateConsentData) CreateConsent(com.authlete.jaxrs.server.obb.model.CreateConsent) Consent(com.authlete.jaxrs.server.obb.model.Consent)

Aggregations

Consent (com.authlete.jaxrs.server.obb.model.Consent)1 CreateConsent (com.authlete.jaxrs.server.obb.model.CreateConsent)1 CreateConsentData (com.authlete.jaxrs.server.obb.model.CreateConsentData)1