Changes between Version 10 and Version 11 of login-service


Ignore:
Timestamp:
Jun 1, 2016, 11:39:13 AM (3 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • login-service

    v10 v11  
    5353=== Python ===
    5454
    55 `mayfirstAuth` is a simple python module (currently only installed on `mcchesney`), source below. It allows a writer of any python script to easily query the login-service.
    56 
    5755'''Usage:'''
    5856
     
    6058#!/usr/bin/python
    6159
    62 from mayfirstAuth import check, user
     60import requests
    6361
    6462username = 'YOUR-USER-NAME'
     
    6664appid = 'YOUR-APP-ID'
    6765
    68 check = check(username, password, appid)
    69 user = user(username, appid)
    70 
    71 if check == "0":
    72     print 'Login success'
    73 else:
    74     print 'Login failure'
    75 
    76 if user == "0":
    77     print 'User exists'
    78 else:
    79     print 'User does not exist'
    80 }}}
    81 
    82 
    83 '''Source:'''
    84 
    85 Save this file as mayfirstAuth.py in /usr/local/lib/python2.7/dist-packages
    86 {{{
    87 #!/usr/bin/python
    88 
    89 import requests
    90 
    91 # set the login service URL
    9266url = 'https://id.mayfirst.org:8080/'
    9367
     
    11488        return "0"
    11589    return "1"
     90
     91if check(username, password, appid) == "0":
     92    print 'Login success'
     93else:
     94    print 'Login failure'
     95
     96if user(username, appid) == "0":
     97    print 'User exists'
     98else:
     99    print 'User does not exist'
     100
    116101}}}
    117 
    118102
    119103=== PHP ===