-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Identity - add browser customization options (#36183)
- Loading branch information
Showing
7 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
...identity/azure-identity/src/main/java/com/azure/identity/BrowserCustomizationOptions.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.identity; | ||
|
||
/** | ||
* Represent Options to customize browser view. | ||
*/ | ||
public class BrowserCustomizationOptions { | ||
private String htmlMessageSuccess; | ||
private String htmlMessageError; | ||
|
||
/** | ||
* Configures the property to set HtmlMessageSuccess which the browser will show to the user when the user | ||
* finishes authenticating successfully. | ||
* | ||
* @param htmlMessageSuccess the message to display when user finishes authenticating. | ||
* @return the updated options. | ||
*/ | ||
public BrowserCustomizationOptions setHtmlMessageSuccess(String htmlMessageSuccess) { | ||
this.htmlMessageSuccess = htmlMessageSuccess; | ||
return this; | ||
} | ||
|
||
/** | ||
* Configure the property to set HtmlMessageError which the browser will show to the user when the user | ||
* finishes authenticating, but an error occurred. You can use a string format e.g. | ||
* "An error has occurred: {0} details: {1}.", the details will be populated by the library. | ||
* | ||
* @param htmlMessageError the message to display when user finishes authenticating, but an error occurred. | ||
* @return the updated options. | ||
*/ | ||
public BrowserCustomizationOptions setHtmlMessageError(String htmlMessageError) { | ||
this.htmlMessageError = htmlMessageError; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get the configured message which the browser will show to the user when the user | ||
* finishes authenticating successfully. | ||
* | ||
* @return the string message. | ||
*/ | ||
public String getHtmlMessageSuccess() { | ||
return this.htmlMessageSuccess; | ||
} | ||
|
||
/** | ||
* Get the configured message which the browser will show to the user when the user | ||
* finishes authenticating, but an error occurred. | ||
* | ||
* @return the string message. | ||
*/ | ||
public String getHtmlMessageError() { | ||
return this.htmlMessageError; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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