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.common.lib.auth;
20  
21  import java.util.Map;
22  import org.apache.syncope.common.lib.to.AuthModuleTO;
23  
24  public class SimpleMfaAuthModuleConf implements MFAAuthModuleConf {
25  
26      private static final long serialVersionUID = -7663257599139312426L;
27  
28      private long timeToKillInSeconds = 30L;
29  
30      private int tokenLength = 6;
31  
32      private String bypassGroovyScript;
33  
34      private String emailAttribute = "email";
35  
36      private String emailFrom;
37  
38      private String emailSubject;
39  
40      private String emailText;
41  
42      @Override
43      public String getFriendlyName() {
44          return "CAS Simple Multifactor Authentication";
45      }
46  
47      public String getEmailFrom() {
48          return emailFrom;
49      }
50  
51      public void setEmailFrom(final String emailFrom) {
52          this.emailFrom = emailFrom;
53      }
54  
55      public String getEmailSubject() {
56          return emailSubject;
57      }
58  
59      public void setEmailSubject(final String emailSubject) {
60          this.emailSubject = emailSubject;
61      }
62  
63      public String getEmailText() {
64          return emailText;
65      }
66  
67      public void setEmailText(final String emailText) {
68          this.emailText = emailText;
69      }
70  
71      public String getBypassGroovyScript() {
72          return bypassGroovyScript;
73      }
74  
75      public void setBypassGroovyScript(final String bypassGroovyScript) {
76          this.bypassGroovyScript = bypassGroovyScript;
77      }
78  
79      public String getEmailAttribute() {
80          return emailAttribute;
81      }
82  
83      public void setEmailAttribute(final String emailAttribute) {
84          this.emailAttribute = emailAttribute;
85      }
86  
87      public long getTimeToKillInSeconds() {
88          return timeToKillInSeconds;
89      }
90  
91      public void setTimeToKillInSeconds(final long timeToKillInSeconds) {
92          this.timeToKillInSeconds = timeToKillInSeconds;
93      }
94  
95      public int getTokenLength() {
96          return tokenLength;
97      }
98  
99      public void setTokenLength(final int tokenLength) {
100         this.tokenLength = tokenLength;
101     }
102 
103     @Override
104     public Map<String, Object> map(final AuthModuleTO authModule, final Mapper mapper) {
105         return mapper.map(authModule, this);
106     }
107 }