gluu
公開メンバ関数 | 公開変数類 | 全メンバ一覧
ConsentGatheringSample.ConsentGathering クラス
ConsentGatheringSample.ConsentGathering の継承関係図
Inheritance graph
ConsentGatheringSample.ConsentGathering 連携図
Collaboration graph

公開メンバ関数

def __init__ (self, currentTimeMillis)
 
def init (self, configurationAttributes)
 
def destroy (self, configurationAttributes)
 
def getApiVersion (self)
 
def authorize (self, step, context)
 
def getNextStep (self, step, context)
 
def prepareForStep (self, step, context)
 
def getStepsCount (self, context)
 
def getPageForStep (self, step, context)
 

公開変数類

 currentTimeMillis
 

詳解

構築子と解体子

◆ __init__()

def ConsentGatheringSample.ConsentGathering.__init__ (   self,
  currentTimeMillis 
)
17  def __init__(self, currentTimeMillis):
18  self.currentTimeMillis = currentTimeMillis
19 

関数詳解

◆ authorize()

def ConsentGatheringSample.ConsentGathering.authorize (   self,
  step,
  context 
)
37  def authorize(self, step, context): # context is reference of org.xdi.oxauth.service.external.context.ConsentGatheringContext
38  print "Consent-Gathering. Authorizing..."
39 
40  if step == 1:
41  allowButton = context.getRequestParameters().get("authorizeForm:allowButton")
42  if (allowButton != None) and (len(allowButton) > 0):
43  print "Consent-Gathering. Authorization success for step 1"
44  return True
45 
46  print "Consent-Gathering. Authorization declined for step 1"
47  elif step == 2:
48  allowButton = context.getRequestParameters().get("authorizeForm:allowButton")
49  if (allowButton != None) and (len(allowButton) > 0):
50  print "Consent-Gathering. Authorization success for step 2"
51  return True
52 
53  print "Consent-Gathering. Authorization declined for step 2"
54 
55  return False
56 

◆ destroy()

def ConsentGatheringSample.ConsentGathering.destroy (   self,
  configurationAttributes 
)
26  def destroy(self, configurationAttributes):
27  print "Consent-Gathering. Destroying ..."
28  print "Consent-Gathering. Destroyed successfully"
29 
30  return True
31 

◆ getApiVersion()

def ConsentGatheringSample.ConsentGathering.getApiVersion (   self)
32  def getApiVersion(self):
33  return 1
34 

◆ getNextStep()

def ConsentGatheringSample.ConsentGathering.getNextStep (   self,
  step,
  context 
)
57  def getNextStep(self, step, context):
58  return -1
59 

◆ getPageForStep()

def ConsentGatheringSample.ConsentGathering.getPageForStep (   self,
  step,
  context 
)
78  def getPageForStep(self, step, context):
79  if step == 1:
80  return "/authz/authorize.xhtml"
81  elif step == 2:
82  return "/authz/transaction.xhtml"
83 
84  return ""
85 

◆ getStepsCount()

def ConsentGatheringSample.ConsentGathering.getStepsCount (   self,
  context 
)
75  def getStepsCount(self, context):
76  return 2
77 

◆ init()

def ConsentGatheringSample.ConsentGathering.init (   self,
  configurationAttributes 
)
20  def init(self, configurationAttributes):
21  print "Consent-Gathering. Initializing ..."
22  print "Consent-Gathering. Initialized successfully"
23 
24  return True
25 

◆ prepareForStep()

def ConsentGatheringSample.ConsentGathering.prepareForStep (   self,
  step,
  context 
)
60  def prepareForStep(self, step, context):
61  if not context.isAuthenticated():
62  print "User is not authenticated. Aborting authorization flow ..."
63  return False
64 
65  if step == 2:
66  pageAttributes = context.getPageAttributes()
67 
68  # Generate random consent gathering request
69  consentRequest = "Requested transaction #%s approval for the amount of sum $ %s.00" % ( random.randint(100000, 1000000), random.randint(1, 100) )
70  pageAttributes.put("consent_request", consentRequest)
71  return True
72 
73  return True
74 

メンバ詳解

◆ currentTimeMillis

ConsentGatheringSample.ConsentGathering.currentTimeMillis

このクラス詳解は次のファイルから抽出されました: