Interface HandleAuthorize

interface HandleAuthorize {
    checkURL(clientData): Boolean;
    getAuthCode(clientData, userInfo): string;
}

Methods

  • checkOauthClient

    Parameters

    Returns Boolean

    Example

    import * as oauth from oauth
    ah=oauth.getAuthorizeHandle()
    clientData = new Map()
    clientData.set("client_id","sadsadasdsa")
    clientData.set("redirectURI","xxx.com")

    let pass=ah.checkURL(clientData)
    let code=ah.getAuthCode(clientData,userInfo)

    @param clientData 客户端请求的中的一些参数例如scop,client_id,redirectURI,state等
  • checkOauthClient

    Parameters

    Returns string

    Example

    import * as oauth from oauth
    ah=oauth.getAuthorizeHandle()
    let userInfo =new Map()
    userInfo.set("name""jack")
    userInfo.set("phone""158xxx")
    let code=ah.getAuthCode(clientData,userInfo)
    @param clientData 客户端请求的中的一些参数例如scop,client_id,redirectURI,state等
    @param userInfo 需要保存的授权用户的信息例如用户名电话地址等