Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vpp platform #563

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Vpp platform #563

wants to merge 22 commits into from

Conversation

jenjac
Copy link
Contributor

@jenjac jenjac commented Jan 29, 2019

Connects the VPP package with Platform and starts with endpoints to get licenses and service config information from stored VPP Tokens.

@jenjac
Copy link
Contributor Author

jenjac commented Feb 6, 2019

Just added mdmctl commands to interact with a VPP token

@jenjac
Copy link
Contributor Author

jenjac commented Feb 7, 2019

This Pull Request now includes everything that you should need to add a single VPP token, and to view apps and licenses within that token, both through api and through mdmctl get vpp-apps/vpp-licenses.

It can also handle VPP Device Assignment using the api, and mdmctl apply/remove vpp-apps.

Copy link

@gavinelder gavinelder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave this a really quick pass, some small formatting comments.

PS like the use of pkg/errors

options.SToken = c.SToken
options.AdamIDStr = appID
if options.AdamIDStr == "" {
return nil, errors.Wrap(nil, "must include adamIdStr")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AdamIDStr ?


var manageVPPLicensesByAdamIdSrvEndpoint endpoint.Endpoint
{
manageVPPLicensesByAdamIdSrvEndpoint = httptransport.NewClient(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, seems that a number of the vars swap between Id and ID I believe it should be consistently applied as ID as per https://github.com/golang/go/wiki/CodeReviewComments#initialisms

@korylprince korylprince mentioned this pull request Mar 1, 2021
@icanhazpython
Copy link

Hi all, what happened to this PR? What is the current status? VPP support would be great, and it seems like most or all of the code is already written and waiting to be merged. It's a damn shame it's sitting here rotting.

@brevilo
Copy link

brevilo commented Jan 18, 2023

Same here. After Apple dropped its own free MDM solution (Server.app) we're looking for an alternative. VPP/ABM is the only part we actually use (just license management, without any DEP). So seeing this merged would solve our problems. What's left/needed to get this PR merged?

@krmzbbr
Copy link
Contributor

krmzbbr commented Feb 19, 2023

I was able to install VPP custom app using these steps:

You need to assign licenses to serial numbers using POST request to the VPP management endpoint (with Bearer token you will get from Apple School/Business Manager/Preferences/Payments And Billing/Server Tokens). "adamId" is the app store id of your application. More info here Associate Assets

POST
https://vpp.itunes.apple.com/mdm/v2/assets/associate
Content-Type: 'application/json'
Authorization: 'Bearer Token'
{
"assets": [
        {
            "adamId": "99999999",
            "pricingParam": "STDQ"
        }       
    ],    
    "serialNumbers": [
        "DMQZXXXXXXXX",
    ]
}

This will let you install VPP apps but I had to use a custom script instead of install_appstore_application because it requires you to submit itunes_store_id (as number) instead of an identifier and add the option purchase_method=1.

If you use an identifier, you will get a "Could not retrieve license for the app" from MDM - I have wasted so many hours until I figured this out.

#!/bin/bash 
source $MICROMDM_ENV_PATH
endpoint="v1/commands"
jq -n \
  --arg request_type "InstallApplication" \
  --arg udid "$1" \
  --arg itunes_store_id $2 \
  '.udid = $udid
  |.request_type = $request_type
  |.itunes_store_id = ($itunes_store_id|tonumber)
  |.options = {"purchase_method": 1}
  '|\
  curl $CURL_OPTS \
    -H "Content-Type: application/json" \
    -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@-

@GregOriol
Copy link

I can confirm that the process described by @krmzbbr works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants