office365 - Building Daemon or Service Apps with Office 365 mail — Secret Upload Automation -
i capable of retrieve app token authenticating certificate on client side , secret in azure ad. question is, possible upload application's certificate secret azure ad automatically? have achieved automation of ad application creation via powershell cmdlet, i'm trying push auotmation next level.
further question is, can consent process automated? understand username/password has manual, can other part of process automated porbably via powershell cmdlet?
mostafa correct there no way automate consent process.
however, can automate setting certificate credential on app.
once you've signed in 'connect-msolservice' , found application principal id 'get-msolserviceprincipal', can following set certificate credential on application.
ps c:\windows\system32> $cer = new-object system.security.cryptography.x509certificates.x509certificate ps c:\windows\system32> $cer.import("path certificate (.cer) file") ps c:\windows\system32> $bincert = $cer.getrawcertdata() ps c:\windows\system32> $credvalue = [system.convert]::tobase64string($bincert); ps c:\windows\system32> new-msolserviceprincipalcredential -appprincipalid "application principal id above" -type asymmetric -value $credvalue -startdate $cer.geteffectivedatestring() -enddate $cer.getexpirationdatestring() -usage verify afterward can verify set via 'get-msolserviceprincipal'.
Comments
Post a Comment