# IPhone Authentication through HTTP Request Header

**URL:** https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [February 2, 2011, 1:39pm UTC](https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085 "2011-02-02T13:39:06Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Samir\_Ghodasara](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Samir\_Ghodasara](https://community.wowza.com/u/Samir_Ghodasara)
#### Post date: [February 2, 2011, 1:39pm UTC](https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085/1 "2011-02-02T13:39:06Z")

</div>

Hi ,

I want to create Module, which reads the http header of the request (iPhone http streaming ) for Authorization.

Till now i am able to create the Module and deploy…i can see below method is getting called for any new http session…

public void onHTTPCupertinoStreamingSessionCreate(HTTPStreamerSessionCupertino httpCupertinoStreamingSession) {}

Question : how to read the http header of request in Module ?

Regards,

Samir.

---

<div class="post-metadata">

### Author: ![Andrew\_Kennedy](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Andrew\_Kennedy](https://community.wowza.com/u/Andrew_Kennedy)
#### Post date: [February 2, 2011, 4:04am UTC](https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085/2 "2011-02-02T04:04:48Z")

</div>

using your reference above the following should work. It should create a map where you can pull out the additional parameters included in the URL

exampl

[http://ip/app/mp4:file.mp4/playlist.m3u8?test=one&this=two&more=three](http://ip/app/mp4:file.mp4/playlist.m3u8?test=one&this=two&more=three)

```auto
import com.wowza.util.*;

public void onHTTPCupertinoStreamingSessionCreate(HTTPStreamer SessionCupertino httpCupertinoStreamingSession) {

Map<String, String> queryParams = HTTPUtils.splitQueryStr(httpCupertinoStreamingSession.getQueryStr());

String Firstone = queryParams.get("test");

}

```

The string Firstone should contain the word one based on the example url.

you might need to do a little debugging as it is off the cuff and not tested.

Shamrock

---

<div class="post-metadata">

### Author: ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)
#### Post date: [February 3, 2011, 5:53am UTC](https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085/3 "2011-02-03T05:53:20Z")

</div>

We do not provide access to the request from the session. We extract data from the request (query params, user agent…). We do not provide direct access.

Charlie

---

<div class="post-metadata">

### Author: ![Andrew\_Kennedy](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Andrew\_Kennedy](https://community.wowza.com/u/Andrew_Kennedy)
#### Post date: [February 3, 2011, 3:12am UTC](https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085/4 "2011-02-03T03:12:38Z")

</div>

try

```auto
String = req.getHeader("Customer-Header");

```

Shamrock

---

<div class="post-metadata">

### Author: ![Andrew\_Kennedy](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Andrew\_Kennedy](https://community.wowza.com/u/Andrew_Kennedy)
#### Post date: [February 5, 2011, 12:37am UTC](https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085/5 "2011-02-05T00:37:01Z")

</div>

Sorry my bad, looks like I was looking at the wrong code when I gave you the example.

Apologies.

Shamrock

---

<div class="post-metadata">

### Author: ![Samir\_Ghodasara](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Samir\_Ghodasara](https://community.wowza.com/u/Samir_Ghodasara)
#### Post date: [February 2, 2011, 6:07pm UTC](https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085/6 "2011-02-02T18:07:52Z")

</div>

Hi Shamrock,

Thanks for the revert , actually i am looking for the http header not the parameter.

GET /rtplive/chnl70/playlist.m3u8 HTTP/1.1

Host: 121.241.248.12:1935

Range: bytes=0-1

Accept: _/_

Accept-Encoding: identity

Connection: keep-alive

User-Agent: AppleCoreMedia/1.0.0.8C148 (iPhone; U; CPU OS 4\_2\_1 like Mac OS X; ko\_kr)

**Custom-Header : Value**

-Samir.

---

<div class="post-metadata">

### Author: ![Samir\_Ghodasara](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Samir\_Ghodasara](https://community.wowza.com/u/Samir_Ghodasara)
#### Post date: [February 3, 2011, 7:15pm UTC](https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085/7 "2011-02-03T19:15:31Z")

</div>

How do i get the reference of req object from HTTPStreamerSessionCupertino object.

-Samir.

---

<div class="post-metadata">

### Author: ![Samir\_Ghodasara](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Samir\_Ghodasara](https://community.wowza.com/u/Samir_Ghodasara)
#### Post date: [February 4, 2011, 10:02am UTC](https://community.wowza.com/t/iphone-authentication-through-http-request-header/36085/8 "2011-02-04T10:02:34Z")

</div>

Thanks Charlie, My main purpose to get the header is to diff the request between iPhone browser vs App.
