GoogleCloudPlatform / GoogleCloudPlatform/deploymentmanager-samples

Deployment manager authentication with Cloud Endpoints

Open
#313 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jinja
Stars
951
Forks
700
PR merge metrics
No merged PRs in 30d

Description

I wanted to know more about the deployment manager authentication against a cloud endpoint.
Documentation states that dm oauth authentication with cloud endpoints works , but there are no examples to guide through.

From the documentation

> Related to the previous point, the API has either basic authentication, or, if the API is running on Google Kubernetes Engine or Google Cloud Endpoints, the API supports OAuth 2.0 authentication using an access token from the project's service account.

I have a app engine API service behind an cloud endpoint. If I have to invoke this API using deployment manager, what are the steps that are needed ?

I used the description url for the Google deployment manager to be the rest api link of the app engine service
```
imports:
- path: echo.jinja

resources:
- name: echo
type: echo.jinja
properties:
discoverydoc: https://some-test.appspot.com/_ah/api/discovery/v1/apis/echo/v1/rest
```

```
{% set RC_TYPE_PROVIDER = env['project'] + '/leotaskprovider:echo.get_user_email' %}

resources:
- name: leotaskprovider
type: deploymentmanager.v2beta.typeProvider
properties:
descriptorUrl: {{ properties["discoverydoc"] }}
options:
inputMappings:
- fieldName: Authorization
location: HEADER
value: >
$.concat("Bearer ", $.googleOauth2AccessToken())

- name: get-user-email
action: {{ RC_TYPE_PROVIDER }}
metadata:
dependsOn:
- leotaskprovider

```
I cannot get the deployment manager successfuly authenticate against a oauth enabled cloud endpoint.
Any pointers ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.