Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/version_4.2.2' into version_4.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Dec 9, 2020
2 parents 8910d5a + 8a2e7b1 commit 1d2ec03
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ public class AppInitializer {

@PostConstruct
public void createApplicationComponents() {
SecurityProviderUtility.installBCProvider();
try {
SecurityProviderUtility.installBCProvider();
} catch (ClassCastException ex) {
log.error("Failed to install BC provider properly");
}
}

public void applicationInitialized(@Observes @Initialized(ApplicationScoped.class) Object init) {
Expand Down
15 changes: 15 additions & 0 deletions Server/uma/sample/UmaClaimsGathering.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#

from org.gluu.model.custom.script.type.uma import UmaClaimsGatheringType
from org.gluu.service.cdi.util import CdiUtil
from org.gluu.oxauth.uma.service import UmaPctService

class UmaClaimsGathering(UmaClaimsGatheringType):

Expand Down Expand Up @@ -85,6 +87,19 @@ def getStepsCount(self, context):
return 2

def getPageForStep(self, step, context):
print "Trying to get claims from PCT ..."
pctCode = context.getRequestParameters().get("pct")
if pctCode is not None:
pct = CdiUtil.bean(UmaPctService).getByCode(pctCode[0])
country = pct.getClaims().getClaimAsString("country")
print "Country from pct: " + country
city = pct.getClaims().getClaimAsString("city")
print "City from pct: " + city

if country == 'US' and city == 'NY':
return ""

print "Claims not found in pct ..."
if step == 1:
return "/uma2/sample/country.xhtml"
elif step == 2:
Expand Down

0 comments on commit 1d2ec03

Please sign in to comment.