/* * Copyright 2014 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. */ package at.gv.egovernment.moa.id.auth.modules.ssotransfer.data; import java.security.cert.CertificateEncodingException; import java.util.Date; import java.util.List; import org.w3c.dom.Element; import at.gv.egiz.eaaf.core.api.idp.auth.data.IIdentityLink; import at.gv.egiz.eaaf.core.impl.data.Pair; import at.gv.egovernment.moa.id.commons.MOAIDAuthConstants; import at.gv.egovernment.moa.id.commons.api.AuthConfiguration; import at.gv.egovernment.moa.id.commons.api.data.IAuthenticationSession; import at.gv.egovernment.moa.id.commons.api.data.IMISMandate; import at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException; import at.gv.egovernment.moa.id.data.AuthenticationRole; import at.gv.egovernment.moa.id.data.IMOAAuthData; import at.gv.egovernment.moa.logging.Logger; /** * @author tlenz * */ public class SSOTransferAuthenticationData implements IMOAAuthData { private IAuthenticationSession authSession = null; boolean isIDPPrivateService = true; public SSOTransferAuthenticationData(AuthConfiguration authConfig, IAuthenticationSession authSession) throws ConfigurationException { this.authSession = authSession; String domainIdentifier = authConfig.getSSOTagetIdentifier(); if (domainIdentifier != null) isIDPPrivateService = domainIdentifier.startsWith(MOAIDAuthConstants.PREFIX_WPBK); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#isBaseIDTransferRestrication() */ @Override public boolean isBaseIDTransferRestrication() { return this.isIDPPrivateService; } @Override public Date getAuthenticationIssueInstant() { // TODO Auto-generated method stub return null; } @Override public String getAuthenticationIssueInstantString() { // TODO Auto-generated method stub return null; } @Override public String getAuthenticationIssuer() { // TODO Auto-generated method stub return null; } @Override public String getCiticenCountryCode() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#isSsoSession() */ @Override public boolean isSsoSession() { return true; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#isUseMandate() */ @Override public boolean isUseMandate() { return this.authSession.isMandateUsed(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getFamilyName() */ @Override public String getFamilyName() { return this.authSession.getIdentityLink().getFamilyName(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getGivenName() */ @Override public String getGivenName() { return this.authSession.getIdentityLink().getGivenName(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getDateOfBirth() */ @Override public Date getDateOfBirth() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getFormatedDateOfBirth() */ @Override public String getFormatedDateOfBirth() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getBPK() */ @Override public String getBPK() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getBPKType() */ @Override public String getBPKType() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getSsoSessionValidTo() */ @Override public Date getSsoSessionValidTo() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getIdentificationValue() */ @Override public String getIdentificationValue() { return this.authSession.getIdentityLink().getIdentificationValue(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getIdentificationType() */ @Override public String getIdentificationType() { return this.authSession.getIdentityLink().getIdentificationType(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getBkuURL() */ @Override public String getBkuURL() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getEncbPKList() */ @Override public List getEncbPKList() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getIdentityLink() */ @Override public IIdentityLink getIdentityLink() { return this.authSession.getIdentityLink(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getSignerCertificate() */ @Override public byte[] getSignerCertificate() { try { return this.authSession.getSignerCertificate().getEncoded(); } catch (CertificateEncodingException e) { Logger.error("SSO-Transfer: SignerCertificate encoding FAILED.", e); return null; } } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getAuthBlock() */ @Override public String getAuthBlock() { return this.authSession.getAuthBlock(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getPvpAttribute_OU() */ @Override public String getPvpAttribute_OU() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getAuthenticationRoles() */ @Override public List getAuthenticationRoles() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#isPublicAuthority() */ @Override public boolean isPublicAuthority() { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getPublicAuthorityCode() */ @Override public String getPublicAuthorityCode() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#isQualifiedCertificate() */ @Override public boolean isQualifiedCertificate() { // TODO Auto-generated method stub return false; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getMISMandate() */ @Override public IMISMandate getMISMandate() { return this.authSession.getMISMandate(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getMandate() */ @Override public Element getMandate() { return this.authSession.getMISMandate().getMandateDOM(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getMandateReferenceValue() */ @Override public String getMandateReferenceValue() { return this.authSession.getMandateReferenceValue(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getQAALevel() */ @Override public String getQAALevel() { return this.authSession.getQAALevel(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getSessionIndex() */ @Override public String getSessionIndex() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getNameID() */ @Override public String getNameID() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getNameIDFormat() */ @Override public String getNameIDFormat() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#isForeigner() */ @Override public boolean isForeigner() { return false; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getEIDASQAALevel() */ @Override public String getEIDASQAALevel() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IAuthData#getGenericData(java.lang.String, java.lang.Class) */ @Override public T getGenericData(String key, Class clazz) { return this.authSession.getGenericDataFromSession(key, clazz); } @Override public String getInterfederatedIDP() { // TODO Auto-generated method stub return null; } @Override public boolean isInterfederatedSSOSession() { // TODO Auto-generated method stub return false; } @Override public List> getAdditionalbPKs() { // TODO Auto-generated method stub return null; } @Override public boolean isIseIDNewDemoMode() { // TODO Auto-generated method stub return false; } }