How to securize redirection with Azure AD in a WebPart?

%3CLINGO-SUB%20id%3D%22lingo-sub-1237628%22%20slang%3D%22es-ES%22%3EHow%20to%20securize%20redirection%20with%20Azure%20AD%20in%20a%20WebPart%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1237628%22%20slang%3D%22es-ES%22%3E%3CP%3E%3CBR%20%2F%3EI%20have%20developed%20a%20Sharepoint%20Webpart.%20The%20aim%20of%20this%20component%20is%20simple%2C%20authenticate%20the%20user%20in%20an%20external%20website%20that%20is%20embedded%20inside%20de%20Sharepoint.%20The%20external%20website%20uses%20Azure%20AD%20to%20login%20the%20users.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20problem%20that%20I%20have%20is%20the%20following.%20I%20know%20how%20to%20get%20obtain%20an%20access%20token%2C%20and%20the%20component%20works%20fine%2C%20with%20a%20great%20security%20leak.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20that%20I%20have%3C%2FP%3E%3CP%3Epublic%20render()%3Avoid%20s%2F%22XXXXXXXXXXXXXXXXXXXXXXXXXXXX%22%3B%20%3CIFRAME%20img%3D%22%22%20src%3D%22%26quot%3Bhttps%3A%2F%2Fwww.example.org%2FoauthCallback.html%3Ftoken%3D%26quot%3B%2Btoken%2F%22%3E%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FP%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BP%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3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Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%3F%20Azure%20redirection%20-%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%20verify%20the%20user%20context%20with%20Azure%20AD%20-%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%20redirect%20the%20callback%20to%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BA%20href%3D%22%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3Ba%20href%3D%22%26amp%3Bamp%3Bamp%3Blt%3Ba%20href%3D%22https%3A%2F%2Fwww.example.org%2FoauthCallback.html%22%20target%3D%22_blank%22%26amp%3Bamp%3Bamp%3Bgt%3Bhttps%3A%2F%2Fwww.example.org%2FoauthCallback.html%26amp%3Bamp%3Bamp%3Blt%3B%2Fa%26amp%3Bamp%3Bamp%3Bgt%3B%22%20target%3D%22_blank%22%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Blt%3Ba%20href%3D%22https%3A%2F%2Fwww.example.org%2FoauthCallback.html%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3B%2Fa%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%22%20target%3D%22_blank%22%26amp%3Bamp%3Bamp%3Bgt%3Bhttps%3A%2F%2Fwww.example.org%2FoauthCallback.html%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3B%2Fa%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%26amp%3Bamp%3Bamp%3Blt%3B%2Fa%26amp%3Bamp%3Bamp%3Bgt%3B%3B%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%22%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3Ba%20href%3D%22%26amp%3Bamp%3Bamp%3Blt%3Ba%20href%3D%22https%3A%2F%2Fwww.example.org%2FoauthCallback.html%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FA%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FP%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BP%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bnbsp%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3B%2FP%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BP%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3BI%22%20target%3D%22_blank%22%26amp%3Bamp%3Bamp%3Bgt%3Bhttps%3A%2F%2Fwww.example.org%2FoauthCallback.html%26amp%3Bamp%3Bamp%3B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amp%3Bamp%3Bgt%3B%3C%2FIFRAME%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1264790%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20securize%20redirection%20with%20Azure%20AD%20in%20a%20WebPart%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1264790%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3EPlease%20refer%20the%20below%20post%20for%20authentication%20and%20also%20auto-logon.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fsharepoint-developer%2Fhow-can-i-auto-logged-an-user-inside-a-sharepoint-web-part%2Fm-p%2F1248512%23M8774%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fsharepoint-developer%2Fhow-can-i-auto-logged-an-user-inside-a-sharepoint-web-part%2Fm-p%2F1248512%23M8774%3C%2FA%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor


I have developed a Sharepoint Webpart. The aim of this component is simple, authenticate the user in an external website that is embedded inside de Sharepoint. The external website uses Azure AD to login the users.

 

The problem that I have is the following. I know how to get obtain an access token, and the component works fine, with a great security leak.

 

This is that I have

public render(): void {
token="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
<iframe img src="https://www.example.org/oauthCallback.html?token="+token/>
}


For this reason, I'm trying to change for something like:

public render(): void {
<iframe img src="Azure redirection"/>
}
Azure redirection -> verify the user context with Azure AD -> redirect the callback to https://www.example.org/oauthCallback.html

 

I want securize this process with Azure AD, but I don't know how to do.

 

Any idea?

 

Regards

1 Reply
Highlighted