Git Product home page Git Product logo

adobeum.azuread's Introduction

AdobeUM.AzureAD

Adopted script originally created by zincarla (https://github.com/zincarla/AdobeUMInterface) and converted it to a PowerShell Module for Azure Automation, providing cmdlets to communicate with the Adobe User Management API.

Available from PowerShell Gallery:
https://www.powershellgallery.com/packages/AdobeUM.AzureAD

Example Runbook

See the following link for an example Runbook the Syncs an Azure AD Group with an Adobe Group:
https://github.com/mrptsai/AdobeUMRunbook

Functions

Import-PFXCert

Description
Import a certificate with a private key from file

Parameters

  • CertPwd - Password to open PFX Bitbucket UserID and Password
  • CertPath - Path to PFX File (ClientID) and Secret

Examples

    Import-PFXCert `
        -CertPwd "ASDF"     
        -CertPath "C:\Cert.pfx"

ConvertTo-Base64URL

Description
Converts a byte[], to a Base64URL encoded string

Parameters

  • Item - A byte[]

Examples

    ConvertTo-Base64URL `
        -Item "VGhpcyBpcyBhIHRlc3Q="

ConvertFrom-Base64URL

Description
Converts a Base64Url string, to a decoded ASCII string.

Parameters

  • Item - A base64url string Bitbucket Account

Examples

    ConvertFrom-Base64URL `
        -Item "VGhpcyBpcyBhIHRlc3Q"

ConvertFrom-Base64URLToBase64

Description
Converts a Base64Url string, to a .Net base64 string.

Parameters

  • Item - A base64url string

Examples

    ConvertFrom-Base64URLToBase64 `
        -Item "VGhpcyBpcyBhIHRlc3Q"

ConvertFrom-Base64URL

Description
Converts a Base64Url string, to a decoded ASCII string.

Parameters

  • Item - A base64url string Bitbucket Account

Examples

    ConvertFrom-Base64URL `
        -Item "VGhpcyBpcyBhIHRlc3Q"

ConvertTo-JavaTime

Description
Converts the [datetime] object passed into a java compliant numerical representation. (milliseconds since 1/1/1970).

Parameters

  • DateTimeObject - A DateTime to be converted

Examples

    ConvertTo-JavaTime `
        -DateTimeObject ([DateTime]::Now)

ConvertFrom-JavaTime

Description
Converts the java compliant numerical representation of time to a .net [datetime] object.

Parameters

  • Item - A base64url string Bitbucket Account

Examples

    ConvertFrom-Base64URL `
        -Item "VGhpcyBpcyBhIHRlc3Q"

ConvertTo-JavaTime

Description
Converts the [datetime] object passed into a java compliant numerical representation. (milliseconds since 1/1/1970).

Parameters

  • JavaTime - A JavaTime to be converted

Examples

    ConvertFrom-JavaTime `
        -JavaTime 1500000000000

ConvertFrom-JavaTime

Description
Converts the java compliant numerical representation of time to a .net [datetime] object.

Parameters

  • Item - A base64url string Bitbucket Account

Examples

    ConvertFrom-Base64URL `
        -Item "VGhpcyBpcyBhIHRlc3Q"

New-ClientInformation

Description
Creates an object to contain client information such as service account details.

Parameters

Outputs
ClientInformation object to be passed to further commands

Examples

    New-ClientInformation `
        -APIKey "1111111111111222222333" `
        -OrganizationID "22222222222222@AdobeOrg" `
        -ClientSecret "xxxx-xxxx-xxxx-xxxx" `
        -TechnicalAccountID "[email protected]" `
        -TechnicalAccountEmail "[email protected]"

Get-AdobeAuthToken

Description
Adds an adobe auth token to the ClientInformation object passed to it

Parameters

Outputs
Attached auth token to ClientInformation.Token

Notes
Create JWT

Examples

    Get-AdobeAuthToken `
        -ClientInformation $MyClient `
        -SignatureCert $Cert `
        -ExpirationInHours 12

Get-AdobeUsers

Description
Gets all users from the adobe API

Parameters

Notes

Examples

    Get-AdobeUsers `
        -ClientInformation $MyClient

Get-AdobeGroups

Description
Grab a list of all groups, or if provided an ID, returns the group related to the ID

Parameters

Notes

Examples

    Get-AdobeGroups `
        -ClientInformation $MyClient

Get-AdobeGroups

Description
Grab a list of all groups, or if provided an ID, returns the group related to the ID

Parameters

Notes

Examples

    Get-AdobeGroups `
        -ClientInformation $MyClient
    
    Get-AdobeGroups `
        -ClientInformation $MyClient `
        -GroupID "222242"

Get-AdobeGroupMembers

Description
Grab all members of the specified group

Parameters

Notes

Examples

    Get-AdobeGroupMembers `
        -ClientInformation $MyClient    
        -GroupID "222424"

Get-AdobeGroupAdmins

Description
Grab all admins of the specified group

Parameters

Notes

Examples

    Get-AdobeGroupAdmins `
        -ClientInformation $MyClient    
        -GroupID "222424"

New-CreateUserRequest

Description
Creates a "CreateUserRequest" object. This object can then be converted to JSON and sent to create a new user

Parameters

  • FirstName - User's First name
  • LastName - User's Last Name
  • Email - User's Email and ID
  • Country - Defaults to AU. This cannot be changed later. (Per adobe documentation)
  • AdditionalActions - An array of additional actions to add to the request. (Like add to group)

Notes
See:
https://www.adobe.io/apis/cloudplatform/usermanagement/docs/samples/samplemultiaction.html

This should be posted to:
https://usermanagement.adobe.io/v2/usermanagement/action/{myOrgID}

Examples

    New-CreateUserRequest `
        -FirstName "John"   
        -LastName "Doe"     
        -Email "[email protected]"
    
    New-CreateUserRequest `
        -FirstName "John"   
        -LastName "Doe"     
        -Email "[email protected]"
        -Country "NZ"

New-RemoveUserRequest

Description
Creates a "RemoveUserRequest" object. This object can then be converted to JSON and sent to remove a user from adobe

Parameters

  • UserName - User's ID, usually e-mail
  • AdditionalActions - An array of additional actions to add to the request. (Like add to group)

Notes
See:
https://www.adobe.io/apis/cloudplatform/usermanagement/docs/samples/samplemultiaction.html

This should be posted to:
https://usermanagement.adobe.io/v2/usermanagement/action/{myOrgID}

Examples

    New-RemoveUserRequest `
        -UserName "[email protected]"

New-UpdateUserRequest

Description
Creates a "UpdateUserRequest" object. This object can then be converted to JSON and sent to update an existing user

Parameters

  • UserName - User's ID, usually e-mail
  • AdditionalActions - An array of additional actions to add to the request. (Like add to group)

Notes
See:
https://www.adobe.io/apis/cloudplatform/usermanagement/docs/samples/samplemultiaction.html

This should be posted to:
https://usermanagement.adobe.io/v2/usermanagement/action/{myOrgID}

Examples

    New-UpdateUserRequest `
        -UserName "[email protected]"

New-RemoveUserFromGroupRequest

Description
Creates a request to remove a user from an Adobe group. This will need to be posted after being converted to a JSON

Parameters

  • UserName - User's ID, usually e-mail
  • GroupName - User's ID, usually e-mail

Notes
See:
https://www.adobe.io/apis/cloudplatform/usermanagement/docs/samples/samplemultiaction.html

This should be posted to:
https://usermanagement.adobe.io/v2/usermanagement/action/{myOrgID}

Examples

    New-RemoveUserFromGroupRequest `
        -UserName "[email protected]" `
        -GroupName "My User Group"

New-GroupUserAddAction

Description
Creates a "Add to group" action. Actions fall under requests. This will have to be added to a request, then json'd and submitted to adobe's API

Parameters

  • Groups - An array of groups that something should be added to

Notes
See:
https://www.adobe.io/apis/cloudplatform/usermanagement/docs/samples/samplemultiaction.html

This should be posted to:
https://usermanagement.adobe.io/v2/usermanagement/action/{myOrgID}

Examples

    New-GroupUserAddAction `
        -Groups "My User Group"

New-GroupUserRemoveAction

Description
Creates a "Remove from group" action. Actions fall under requests. This will have to be added to a request, then json'd and submitted to adobe's API

Parameters

  • Groups - An array of groups that something should be added to

Notes
See:
https://www.adobe.io/apis/cloudplatform/usermanagement/docs/samples/samplemultiaction.html

This should be posted to:
https://usermanagement.adobe.io/v2/usermanagement/action/{myOrgID}

Examples

    New-GroupUserRemoveAction `
        -Groups "My User Group"

New-AddToGroupRequest

Description
Creates a "Add user to group" request. This will need to be json'd and sent to adobe

Parameters

  • Groups - An array of groups that something should be added to
  • User - A User to be added to the Group(s)

Notes
See:
https://www.adobe.io/apis/cloudplatform/usermanagement/docs/samples/samplemultiaction.html

This should be posted to:
https://usermanagement.adobe.io/v2/usermanagement/action/{myOrgID}

Examples

    New-AddToGroupRequest `
        -Groups "My User Group"     
        -User "[email protected]"

New-RemoveFromGroupRequest

Description
Creates a "Remove user from group" request. This will need to be json'd and sent to adobe

Parameters

  • Groups - An array of groups that something should be removed from
  • User - A User to be removed from the Group(s)

Notes
See:
https://www.adobe.io/apis/cloudplatform/usermanagement/docs/samples/samplemultiaction.html

This should be posted to:
https://usermanagement.adobe.io/v2/usermanagement/action/{myOrgID}

Examples

    New-RemoveFromGroupRequest `
        -Groups "My User Group"     
        -User "[email protected]"

Expand-JWTInformation

Description
Unpacks a JWT object into it's header, and body components. (Human readable format)

Parameters

  • JWTObject - JWT To unpack. In format of {Base64Header}.{Base64Body}.{Base64Signature}
  • SigningCert - A certificate with the necesary public key to verify signature block. Can be null, will not validate signature.

Notes
See:
https://www.adobe.io/apis/cloudplatform/usermanagement/docs/samples/samplemultiaction.html

This should be posted to:
https://usermanagement.adobe.io/v2/usermanagement/action/{myOrgID}

Examples

    Expand-JWTInformation `
        -JWTObject "xxxx.xxxx.xxx"

Send-UserManagementRequest

Description
Sends a request, or array of requests, to adobe's user management endpoint

Parameters

  • ClientInformation - ClientInformation object containing service account info and token
  • Requests - An array of requests to send to Adobe.

Notes
See:
Create-*Request

Examples

    Send-UserManagementRequest `
        -ClientInformation $MyClientInfo `
        -Requests ( `
            New-CreateUserRequest `
                -FirstName "John" `
                -LastName "Doe" `
                -Email "[email protected]" `
                -Country="AU" `
        )

New-SyncADGroupRequest

Description
Creates an array of requests that, when considered together, ensures an Adobe group will mirror an Azure AD group

Parameters

  • ADGroupID - Azure AD Group Identifier. The source group to mirror to Adobe
  • AdobeGroupID - Adobe group ID as retured from Get-AdobeGroups
  • ClientInformation - Service account information including token

Examples

    New-SyncADGroupRequest `
        -ADGroupID "SG-My-Approved-Adobe-Users" `    
        -AdobeGroupID "111222422" `
        -ClientInformation $MyClientInfo

New-RemoveUnusedAbobeUsersRequest

Description
Creates an array of requests that, when considered together, removes all users that are not admins, and not part of any user groups

Parameters

  • ClientInformation - Service account information including token

Examples

    New-RemoveUnusedAbobeUsersRequest `
        -ClientInformation $MyClientInfo

Prerequisites

  • Azure Tenant
  • Azure Automation Account

Versioning

Github for version control.

Authors

See also the list of contributors who participated in this project.

adobeum.azuread's People

Contributors

mrptsai avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

adobeum.azuread's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.