generated from adempiere/adempiere-template-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d7b4f9
commit 3f90911
Showing
10 changed files
with
383 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
arguments= | ||
auto.sync=false | ||
build.scans.enabled=false | ||
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.6.1)) | ||
connection.project.dir= | ||
eclipse.preferences.version=1 | ||
gradle.user.home= | ||
java.home= | ||
jvm.arguments= | ||
offline.mode=false | ||
override.workspace.settings=true | ||
show.console.view=true | ||
show.executions.view=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rootProject.name = 'adempiere-template-project' | ||
rootProject.name = 'adempiere-open-id-connector' |
66 changes: 66 additions & 0 deletions
66
src/main/java/org/spin/authentication/services/addons/provider/GenericAuthentication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/****************************************************************************** | ||
* Product: Adempiere ERP & CRM Smart Business Solution * | ||
* This program is free software; you can redistribute it and/or modify it * | ||
* under the terms version 2 of the GNU General Public License as published * | ||
* by the Free Software Foundation. This program is distributed in the hope * | ||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * | ||
* See the GNU General Public License for more details. * | ||
* You should have received a copy of the GNU General Public License along * | ||
* with this program; if not, write to the Free Software Foundation, Inc., * | ||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * | ||
* For the text or an alternative of this public license, you may reach us * | ||
* Copyright (C) 2003-2015 E.R.P. Consultores y Asociados, C.A. * | ||
* All Rights Reserved. * | ||
* Contributor(s): Carlos Parada www.erpya.com * | ||
*****************************************************************************/ | ||
package org.spin.authentication.services.addons.provider; | ||
|
||
import java.util.Optional; | ||
import org.spin.authentication.services.OpenIDConnect; | ||
import org.spin.model.MADAppRegistration; | ||
import com.nimbusds.oauth2.sdk.ResponseType; | ||
|
||
/** | ||
* @author Carlos Parada, cparada@erpya.com, ERPCyA http://www.erpya.com | ||
* Add support to login with Generic Open ID service | ||
*/ | ||
public class GenericAuthentication extends OpenIDConnect{ | ||
|
||
/**Default Scope*/ | ||
private final static String defaultScope = "openid,email,profile"; | ||
/**Authorization End point Tag*/ | ||
private static final String AUTHORIZATION_ENDPOINT_TAG = "AUTHORIZATION_ENDPOINT"; | ||
/**Token End point Tag*/ | ||
private static final String TOKEN_ENDPOINT_TAG = "TOKEN_ENDPOINT"; | ||
/**User Info End point Tag*/ | ||
private static final String USERINFO_ENDPOINT_TAG = "USERINFO_ENDPOINT"; | ||
/**Scope Parameter*/ | ||
private static final String PARAMETER_SCOPE = "SCOPE"; | ||
/** | ||
* Constructor | ||
*/ | ||
public GenericAuthentication() { | ||
super(); | ||
setResponseType(new ResponseType(ResponseType.Value.CODE)); | ||
} | ||
|
||
/*** | ||
* Set Default values from Application Registration | ||
*/ | ||
@Override | ||
public void setAppRegistrationId(int registrationId) { | ||
super.setAppRegistrationId(registrationId); | ||
Optional<MADAppRegistration> maybeApRegistration = Optional.ofNullable(getApplicationRegistration()); | ||
maybeApRegistration.ifPresent(appRegistration -> { | ||
String authorizationEndPoint = Optional.ofNullable(appRegistration.getParameterValue(AUTHORIZATION_ENDPOINT_TAG)).orElse(""); | ||
String tokenEndPoint = Optional.ofNullable(appRegistration.getParameterValue(TOKEN_ENDPOINT_TAG)).orElse(""); | ||
String userInfoEndPoint = Optional.ofNullable(appRegistration.getParameterValue(USERINFO_ENDPOINT_TAG)).orElse(""); | ||
String scope = Optional.ofNullable(appRegistration.getParameterValue(PARAMETER_SCOPE)).orElse(defaultScope); | ||
setAuthorizationEndPoint(authorizationEndPoint); | ||
setTokenEndpoint(tokenEndPoint); | ||
setUserInfoEndpoint(userInfoEndPoint); | ||
setScope(scope.split(",")); | ||
}); | ||
} | ||
} |
96 changes: 0 additions & 96 deletions
96
src/main/java/org/spin/template/model/validator/Validator.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.