This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var AuthRequest = require("launchkey-sdk").AuthRequest, | |
| authRequest = new AuthRequest("auth request ID"); | |
| launchKey.deOrbit(authRequest); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| launchKey.authenticate( | |
| "LaunchKeyUserName", | |
| function (authRequest) { | |
| console.log("Authentication request successful", authRequest); | |
| }, | |
| function (error) { | |
| console.error("Error processsing authentication request!", error); | |
| } | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var LaunchKey = require("launchkey-sdk"), | |
| appKey = "1234567890", | |
| secretKey = "qwertyuiodfghjklcvbnm", | |
| privateKey = "-----BEGIN RSA PRIVATE KEY-----...-----END RSA PRIVATE KEY-----", | |
| launchKey; | |
| launchKey = new LaunchKey(appKey, secretKey, privateKey); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var logoutResult = await LKOAuthManager.Instance.logout(accessToken) as LaunchKeyLogoutResponse; | |
| public class LaunchKeyLogoutResponse | |
| { | |
| public bool Successful { get; set; } | |
| public bool LoggedOut { get; set; } | |
| public string ErrorMessage { get; set; } | |
| public string ErrorCode { get; set; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var authorizationResult = await LKOAuthManager.Instance.isAuthorized(accessToken) as LaunchKeyIsAuthorizedResponse; | |
| public class LaunchKeyIsAuthorizedResponse | |
| { | |
| public bool Successful { get; set; } | |
| public bool Authorized { get; set; } | |
| public string ErrorMessage { get; set; } | |
| public string ErrorCode { get; set; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void loginSuccessCallback(string userId, string accessToken) | |
| { | |
| // success | |
| } | |
| public void loginFailureCallback(string errorMessage, string errorCode) | |
| { | |
| // failure | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LKOAuthManager.Instance.promptForLaunchKeyLogin(loginSuccessCallback, loginFailureCallback); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using LaunchKeyManager; | |
| LKOAuthManager.Instance.init(appKey, redirectUri); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IsLoggedOutResponse response = await LKAuthenticationManager.Instance.logout(_authRequest) as IsLoggedOutResponse; | |
| if (response.LoggedOut) | |
| { | |
| //logged out | |
| } |