-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPendoAuthProvider.bbj
68 lines (53 loc) · 2.11 KB
/
PendoAuthProvider.bbj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
REM /**
REM * PendoAuthProvider.bbj
REM * @author melihsunal
REM *
REM */
use ::BBjPendo.bbj::BBjPendo
use ::AuthKit/profile/AccountProfile.bbj::AccountProfile
use ::WebKit/framework/LoginDialog/BBjUser.bbj::BBjUser
use ::WebKit/framework/LoginDialog/IAuthProvider.bbj::IAuthProvider
class public PendoAuthProvider implements IAuthProvider
field private BBjString token!
field private AccountProfile profile!
method public Boolean checkLogin(BBjString username!, BBjString password!)
#token! = com.basis.api.admin.BBjAdminFactory.getAuthToken(username!, password!, err=invalid)
#profile!= new BBjUser(username!)
declare BBjPendo p!
p! = new BBjPendo()
p!.setApiKey(stbl("PENDOAPIKEY",err=*next))
p!.setUserInformation("0915")
p!.setCustomUserInfo("GB","11.11.1111")
p!.setCustomAccountInfo("ACC_CREATION","12.12.1212")
p!.setCustomAccountInfo("email","melih.sunal")
p!.setAccountInformation("103")
p!.initPendo()
methodret Boolean.TRUE
invalid:
methodret Boolean.FALSE
methodend
method public Boolean checkLoginWithAccountProfile(AccountProfile profile!)
rem for this sample accept all external profiles
#profile!= profile!
methodret Boolean.TRUE
methodend
method public Boolean checkToken(BBjString token!)
token$ = com.basis.api.admin.BBjAdminFactory.renewAuthToken(token!,err=invalid)
#token! = token$
adm! = com.basis.api.admin.BBjAdminFactory.getBBjAdmin(token!,err=invalid)
X$=adm!.getUser()
#profile!= new BBjUser(x$)
methodret Boolean.TRUE
invalid:
methodret Boolean.FALSE
methodend
method public BBjString getToken()
methodret #token!
methodend
method public BBjString getUser()
methodret #profile!.getFullName()
methodend
method public AccountProfile getProfile()
methodret #profile!
methodend
classend