Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Fix for issue #185 - BearerStrategy profileName issue. #186

Closed
wants to merge 3 commits into from

Conversation

brandwe
Copy link
Contributor

@brandwe brandwe commented Aug 30, 2016

No description provided.

@@ -293,8 +293,9 @@ Strategy.prototype.authenticate = function authenticateStrategy(req) {

var metadataURL = self._options.identityMetadata;

if (self._options.policyName) {
log.info('B2C: using policy %s', self._options.policyName);
if (!self._options.policyName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we really be erroring any time there's no policyName? What if we're not using B2C- there'd be no policy here, right? And why remove the log info on the policy?

Copy link
Contributor Author

@brandwe brandwe Aug 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, the change can be reverted here. Will update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what I realize I did when I first added B2C was use policyName as the trigger for doing B2C work, so logging that it isn't there isn't correct behavior. Reverted.

@@ -294,7 +294,7 @@ Strategy.prototype.authenticate = function authenticateStrategy(req) {
var metadataURL = self._options.identityMetadata;

if (self._options.policyName) {
log.info('B2C: using policy %s', self._options.policyName);
log.info('B2C: using policy %s', self._options.policyName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the indentation look off here? Where are we closing the open bracket on the if line above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said before, this is the signal to use the B2C flow, so this is if statement is quite large (it sets the stage for B2C, including creating a new caching key for policy). The end of the if statement is line number 312:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brandwe There should be two extra blanks in front of 297.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brandwe You should just revert the change on line 297, as @lovemaths says.

@polita
Copy link
Contributor

polita commented Sep 1, 2016

@lovemaths Please test this against a B2C tenant before we merge the change. Looks like we might need a fix to #187 before the E2E will work.

@polita polita closed this Sep 12, 2016
@lovemaths lovemaths deleted the brandwe-policyFix branch September 29, 2016 05:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants