View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.core.logic.oidc;
20  
21  import java.util.Collection;
22  import java.util.Map;
23  import java.util.Optional;
24  import java.util.Set;
25  import javax.ws.rs.HttpMethod;
26  import org.pac4j.core.context.Cookie;
27  import org.pac4j.core.context.WebContext;
28  
29  public class OIDCC4UIContext implements WebContext {
30  
31      @Override
32      public String getRequestMethod() {
33          return HttpMethod.GET;
34      }
35  
36      @Override
37      public Optional<String> getRequestParameter(final String name) {
38          return Optional.empty();
39      }
40  
41      @Override
42      public Map<String, String[]> getRequestParameters() {
43          throw new UnsupportedOperationException();
44      }
45  
46      @Override
47      public Optional<String> getRequestAttribute(final String name) {
48          return Optional.empty();
49      }
50  
51      @Override
52      public void setRequestAttribute(final String name, final Object value) {
53          // nothing to do
54      }
55  
56      @Override
57      public Optional<String> getRequestHeader(final String name) {
58          return Optional.empty();
59      }
60  
61      @Override
62      public String getRemoteAddr() {
63          return null;
64      }
65  
66      @Override
67      public void setResponseHeader(final String name, final String value) {
68          // nothing to do
69      }
70  
71      @Override
72      public Optional<String> getResponseHeader(final String s) {
73          return Optional.empty();
74      }
75  
76      @Override
77      public String getServerName() {
78          return null;
79      }
80  
81      @Override
82      public int getServerPort() {
83          throw new UnsupportedOperationException();
84      }
85  
86      @Override
87      public String getScheme() {
88          return null;
89      }
90  
91      @Override
92      public boolean isSecure() {
93          return false;
94      }
95  
96      @Override
97      public String getFullRequestURL() {
98          return null;
99      }
100 
101     @Override
102     public Collection<Cookie> getRequestCookies() {
103         return Set.of();
104     }
105 
106     @Override
107     public void addResponseCookie(final Cookie cookie) {
108         // nothing to do
109     }
110 
111     @Override
112     public String getPath() {
113         return null;
114     }
115 
116     @Override
117     public void setResponseContentType(final String content) {
118         // nothing to do
119     }
120 }