001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2025 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.model.json;
011
012import ca.uhn.fhir.model.api.IModelJson;
013import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
014import com.fasterxml.jackson.annotation.JsonProperty;
015import io.swagger.v3.oas.annotations.media.Schema;
016
017/**
018 * A client-credentials token response
019 * <a ref="https://datatracker.ietf.org/doc/html/rfc6749">oidc spec</a>
020 */
021@Schema(
022                name = "OpenIdTokenResponse",
023                description =
024                                "This object represents the response from a client-credentials request to an Identity Provider's token endpoint.")
025@JsonIgnoreProperties(ignoreUnknown = true)
026public class OpenIdTokenResponse implements IModelJson {
027
028        /* CHECKSTYLE.OFF: RegexpSingleLine - these properties are spec compliant and should not be changed */
029
030        /**
031         * REQUIRED
032         * The token we've requested
033         */
034        @JsonProperty("access_token")
035        private String myAccessToken;
036
037        /**
038         * REQUIRED
039         * The token type ("bearer", "mac")...
040         * We should only ever receive "bearer" (as that's all we support).
041         */
042        @JsonProperty("token_type")
043        private String myTokenType;
044
045        /**
046         * RECOMMENDED
047         * The lifetime (in seconds) of the access_token.
048         * MAy or may not be included.
049         */
050        @JsonProperty("expires_in")
051        private Long myExpiration;
052
053        /**
054         * OPTIONAL
055         * Only provided if this was a refresh_token request.
056         */
057        @JsonProperty("refresh_token")
058        private String myRefreshToken;
059
060        /* CHECKSTYLE.ON: RegexpSingleLine */
061
062        public String getAccessToken() {
063                return myAccessToken;
064        }
065
066        public void setAccessToken(String theAccessToken) {
067                myAccessToken = theAccessToken;
068        }
069
070        public String getTokenType() {
071                return myTokenType;
072        }
073
074        public void setTokenType(String theTokenType) {
075                myTokenType = theTokenType;
076        }
077
078        public Long getExpiration() {
079                return myExpiration;
080        }
081
082        public void setExpiration(Long theExpiration) {
083                myExpiration = theExpiration;
084        }
085
086        public String getRefreshToken() {
087                return myRefreshToken;
088        }
089
090        public void setRefreshToken(String theRefreshToken) {
091                myRefreshToken = theRefreshToken;
092        }
093}