Merge "Update ONF12 devicemanager"
[ccsdk/features.git] / sdnr / wt / oauth-provider / provider-jar / src / main / java / org / onap / ccsdk / features / sdnr / wt / oauthprovider / data / KeycloakUserTokenPayload.java
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP : ccsdk features
4  * ================================================================================
5  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  */
22 package org.onap.ccsdk.features.sdnr.wt.oauthprovider.data;
23
24 import com.fasterxml.jackson.annotation.JsonProperty;
25 import java.util.List;
26
27 /**
28  * {
29   "exp": 1610362593,
30   "iat": 1610361393,
31   "jti": "09bd6f2c-5dba-44a0-bd76-cd0d440137d0",
32   "iss": "http://10.20.11.160:8080/auth/realms/onap",
33   "aud": "account",
34   "sub": "446a24bc-d8a0-43dd-afa5-e56eed75deb8",
35   "typ": "Bearer",
36   "azp": "admin-cli",
37   "session_state": "db2c96f4-cc9b-47e8-a83f-a01c50d656f2",
38   "acr": "1",
39   "realm_access": {
40     "roles": [
41       "provision",
42       "offline_access",
43       "uma_authorization"
44     ]
45   },
46   "resource_access": {
47     "account": {
48       "roles": [
49         "manage-account",
50         "manage-account-links",
51         "view-profile"
52       ]
53     }
54   },
55   "scope": "profile email",
56   "email_verified": false,
57   "name": "Luke Skywalker",
58   "preferred_username": "luke.skywalker",
59   "given_name": "Luke",
60   "family_name": "Skywalker",
61   "email": "luke.skywalker@sdnr.onap.org"
62 }
63  * @author jack
64  *
65  */
66 public class KeycloakUserTokenPayload {
67
68     private long exp;
69     private long iat;
70     private String jti;
71     private String iss;
72     private String aud;
73     private String sub;
74     private String typ;
75     private String azp;
76     @JsonProperty("session_state")
77     private String sessionState;
78     private String acr;
79     @JsonProperty("realm_access")
80     private RealmAccessData realmAccess;
81     @JsonProperty("resource_access")
82     private ResourceAccessData resourceAccess;
83     private String scope;
84     @JsonProperty("email_verified")
85     private String emailVerified;
86     private String name;
87     @JsonProperty("preferred_username")
88     private String preferredUsername;
89     @JsonProperty("given_name")
90     private String givenName;
91     @JsonProperty("family_name")
92     private String familyName;
93     private String email;
94
95     public long getExp() {
96         return exp;
97     }
98     public void setExp(long exp) {
99         this.exp = exp;
100     }
101     public long getIat() {
102         return iat;
103     }
104     public void setIat(long iat) {
105         this.iat = iat;
106     }
107     public String getJti() {
108         return jti;
109     }
110     public void setJti(String jti) {
111         this.jti = jti;
112     }
113     public String getIss() {
114         return iss;
115     }
116     public void setIss(String iss) {
117         this.iss = iss;
118     }
119     public String getAud() {
120         return aud;
121     }
122     public void setAud(String aud) {
123         this.aud = aud;
124     }
125     public String getSub() {
126         return sub;
127     }
128     public void setSub(String sub) {
129         this.sub = sub;
130     }
131     public String getTyp() {
132         return typ;
133     }
134     public void setTyp(String typ) {
135         this.typ = typ;
136     }
137     public String getAzp() {
138         return azp;
139     }
140     public void setAzp(String azp) {
141         this.azp = azp;
142     }
143     public String getSessionState() {
144         return sessionState;
145     }
146     public void setSessionState(String sessionState) {
147         this.sessionState = sessionState;
148     }
149     public String getAcr() {
150         return acr;
151     }
152     public void setAcr(String acr) {
153         this.acr = acr;
154     }
155     public RealmAccessData getRealmAccess() {
156         return realmAccess;
157     }
158     public void setRealmAccess(RealmAccessData realmAccess) {
159         this.realmAccess = realmAccess;
160     }
161     public ResourceAccessData getResourceAccess() {
162         return resourceAccess;
163     }
164     public void setResourceAccess(ResourceAccessData resourceAccess) {
165         this.resourceAccess = resourceAccess;
166     }
167     public String getScope() {
168         return scope;
169     }
170     public void setScope(String scope) {
171         this.scope = scope;
172     }
173     public String getEmailVerified() {
174         return emailVerified;
175     }
176     public void setEmailVerified(String emailVerified) {
177         this.emailVerified = emailVerified;
178     }
179     public String getName() {
180         return name;
181     }
182     public void setName(String name) {
183         this.name = name;
184     }
185     public String getPreferredUsername() {
186         return preferredUsername;
187     }
188     public void setPreferredUsername(String preferredUsername) {
189         this.preferredUsername = preferredUsername;
190     }
191     public String getGivenName() {
192         return givenName;
193     }
194     public void setGivenName(String givenName) {
195         this.givenName = givenName;
196     }
197     public String getFamilyName() {
198         return familyName;
199     }
200     public void setFamilyName(String familyName) {
201         this.familyName = familyName;
202     }
203     public String getEmail() {
204         return email;
205     }
206     public void setEmail(String email) {
207         this.email = email;
208     }
209
210
211     public static class RealmAccessData {
212         private List<String> roles;
213
214         public List<String> getRoles(){
215             return this.roles;
216         }
217         public void setRoles(List<String> roles) {
218             this.roles = roles;
219         }
220     }
221     public static class ResourceAccessData {
222         private RealmAccessData account;
223
224         public RealmAccessData getAccount() {
225             return this.account;
226         }
227         public void setAccount(RealmAccessData account) {
228             this.account = account;
229         }
230     }
231 }