Skip to content

Commit 1b98fa8

Browse files
liliankasemzmmille2
authored andcommitted
Updating README resources; updating code snippets to jsx
1 parent 0b8dcef commit 1b98fa8

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Find the assignment for ClientID and replace the value with the Application ID f
7777

7878
- `userInfoCallback`: A user defined callback function. The AzureAD library will calls this function when login is complete to pass back the user info in the following format:
7979

80-
``` javascript
80+
```
8181
IUserInfo {
8282
jwtAccessToken: string,
8383
jwtIdToken: string,
@@ -100,7 +100,7 @@ Find the assignment for ClientID and replace the value with the Application ID f
100100
## Login
101101
To login, first create a callback function for the AzureAD component to consume. This function will be called when the component loads, and it will pass in the function to be called when the user wants to login. In this case, we create a button that will log the user in.
102102
103-
``` javascript
103+
``` jsx
104104
import AzureAD from 'AzureAD'
105105
106106
loginCallback = (login) => {
@@ -179,9 +179,10 @@ const sampleReducer = (state = initialState, action) => {
179179
180180
A sample React-based Single Page Application (SPA) that uses this component is available in the [sample folder](sample/README.md). There you'll find a couple implementations that leverage the library, as well as a tutorial of how to set up Azure Active Directory with an Identity Provider.
181181
182-
## Resources //TODO
182+
## Resources
183183
184-
- [Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory/get-started-azure-ad)
184+
- [React AAD MSAL NPM Module](https://www.npmjs.com/package/react-aad-msal)
185+
- [Get Started with Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory/get-started-azure-ad)
185186
- [MSAL Documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/AzureAD/microsoft-authentication-library-for-js/dev/docs/index.html)
186187
- [AAD v2 Scopes](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-scopes)
187188
- [AAD B22 Setup MSA App](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-setup-msa-app)

sample/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ userJustLoggedIn = receivedUserInfo => {
9696

9797
For our `unauthenticatedFunction` property, we setup a function that returns a button that uses the login function provided by our AzureAD component.
9898

99-
``` javascript
99+
``` jsx
100100
unauthenticatedFunction = loginFunction => {
101101
return (
102102
<button className="Button" onClick={loginFunction}>Login</button>
@@ -106,7 +106,7 @@ unauthenticatedFunction = loginFunction => {
106106

107107
For our `authenticatedFunction` property, we setup a function that returns a button that uses the logout function provided by our AzureAD component.
108108

109-
``` javascript
109+
``` jsx
110110
authenticatedFunction = (logout) => {
111111
return (<div>
112112
You're logged in!
@@ -140,7 +140,7 @@ userJustLoggedIn = receivedUserInfo => {
140140
141141
For our `unauthenticatedFunction` property, we setup a function that returns a a div that lets the user know we are going to redirect them, and uses the login function provided by our AzureAD component to complete the login in a new window.
142142
143-
``` javascript
143+
``` jsx
144144
unauthenticatedFunction = loginFunction => {
145145
if (this.state.redirectEnabled && !this.interval) {
146146
this.interval = setInterval(() => {
@@ -164,10 +164,16 @@ unauthenticatedFunction = loginFunction => {
164164
165165
For our `authenticatedFunction` property, we setup a function that returns a button that uses the logout function provided by our AzureAD component.
166166
167-
``` javascript
167+
``` jsx
168168
authenticatedFunction = logout => {
169169
return (<div><button onClick={() => {
170170
logout();
171171
}} className="Button">Logout</button></div>);
172172
}
173173
```
174+
175+
## Resources
176+
177+
- [React AAD MSAL NPM Module](https://www.npmjs.com/package/react-aad-msal)
178+
- [Getting Started with an Azure AD App](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal)
179+
- [Getting Started with an Azure AD B2C App](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-app-registration)

0 commit comments

Comments
 (0)