Does edgemicro supports password grant OAuth??

Not applicable

Hi All,

What all grant types edgemicro supports?? Has anyone implemented password grant OAuth in edgemicro?? If yes then please guide us to implement the same.

Thanks

1 6 458
6 REPLIES 6

Former Community Member
Not applicable

The only grant type implemented out of the box is client credentials. Having said that, there is ability to allow for password grant also.

1: The org and environment that has edgemicro deployed has a proxy called edgemicro-auth. This is a node.js proxy (uses a127).

2: Locate the script api/helpers/password_check.js

The code is left empty for users to provide their implementation:

'use strict';

module.exports = {
  passwordCheck: passwordCheck
};

function passwordCheck(username, password, cb) {

  var validPassword = false;

  // todo: do what you need to do here!

  cb(null, validPassword);
}

You can use other node.js modules like ldapjs to connect to a LDAP and authenticate the user.

@Srinandan Sridhar I can't find this script api/helpers/password_check.js has this changed?

Former Community Member
Not applicable

Yes, this proxy has heavily changed. You can get the latest proxy by:

1) upgrade to the latest edgemicro

npm install -g edgemicro

2) install latest proxy

edgemicro upgradeauth -o {org} -e {env} -u {user}

@Srinandan Sridhar thanks for quick reply and I did as you suggested. I found we already have the latest revision but I can't find this method in there. The new version does still have have some conditional logic for the password grant type in the refresh token, but can't find it in the generate token where it would need to be.

@Srinandan Sridhar I'm assuming I now follow the instructions more closely for the Oauth endpoint and insert a Java Callout step ahead of the GenerateToken to verify the user from my IDP or BaaS

Former Community Member
Not applicable

Thatright. The proxy is a regular Apigee proxy now, not a node js app. You could use service callouts and or Java to validate the user credentials.