Question: i trying to bind dropdown values using function inside this making call to firestore then i am returning value using promise 

HTML

```
<template is="dom-repeat" items="{{_modOptsArry(item.modKey)}}" as="opt">
     <paper-item value="{{opt.$key}}">{{opt.obj.val}}</paper-item>
</template>

```

JavaScript

```
_modOptsArry(modeKey) { 
    let opts = [];
    var promise = new Promise((resolve, reject) => {
        firebase.firestore().collection("record").doc("s1").collection("class").orderBy('o').onSnapshot(function (querySnapshot) {
            // let opts = [];
            querySnapshot.forEach(function (doc) { 
                var model = doc.data(); 
                opts.push({ $key: doc.id, obj: { val: model.nm } });
            });
            resolve(opts); 
        })
    })
    promise.then(function (result) {
        return Promise.resolve(result); // Here i am returning array but in the dom-repeat it not binding values because it is returning Promise Object My Array is there inside this Promise object. how to resolve this problem..
    }); 
}

```

Answer: 
There isn't a preauthorized URI for user/group/contact photos available. 

Instead, retrieve the image on your backend and serve it out to the page like a normal image asset. Aside from removing the authentication issue, it will allow you to cache those images for a period of time rather than pulling down every time. 

Alternativly, you can convert the image to base64 and return it as a [Data URI](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) that you can use directly in an `<image>` tag like this:

```
<image src="data:image;base64,{data}" />

```
You need to add the Authorization Header to your HTTP-Request

HeaderName: "Authorization" 

Content: "Bearer < token >"

Your Request message will look sth. like this

```
fetch("https://graph.microsoft.com/v1.0/me/contacts/" + item.id + "/photo/$value", {
    headers: {
      'user-agent': 'Mozilla/4.0 MDN Example',
      'content-type': 'application/json'
      'Authorization' : 'Bearer <AuthToken>'
    },
    method: 'GET', // *POST, PUT, DELETE, etc.
  })

```

See <https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch> for detailed description how to add the header

And <https://developer.microsoft.com/en-us/graph/docs/concepts/auth_overview> for more information about Graph Auth Tokens